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.
Binary Tree の preorder および postorder トラバーサルの特定のアプリケーションはありますか?
PS: Inorder Traversal の適用: BST からソートされた数値を出力するために使用されます。
ツリーのシリアライズはどうですか?たとえば、ヒープは通常、事前順序で格納されます。これは、固定要素サイズの正規のシリアル化順序になります。
要素のサイズが動的である場合、子ポインターを先行順に書き出すことはできないため、後続トラバーサルの方が適切です。一部の最新の B+ ツリー ディスク レイアウトでは、ポスト オーダー IIRC も使用されますが、動的な変更を考慮する必要があるため、厳密なポスト オーダー レイアウトではありません。