Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
各ノードには絶対レベルがあり、直接の親の中に絶対インデックスがあることを考えると、カスタムツリー構造の一意のzインデックスを自分で理解することはできないようです。
挿入/削除時に他のノードのために再計算する必要なしに、ノードごとにそのようなものを一意に計算する方法のアイデア(もちろん、ノードのインデックスが変更された場合を除く)。