- Full/Strict, every node except leaf nodes have two children
- Complete, every level except the last(left justified) is completely filled
- Perfect, every node except the leaf nodes have two children and all level are completely filled
DFS and BFS are two broad traversal algorithms.
- DFS is divided into pre-order, inorder, postorder.They can be implemented as recursive(very simple) and non-recursive.
- BFS is non-recursive using queue
PATHSUM from rootToleaf or anyPath illustrates the DFS variations The basic BFS without and with recursion is here. Some similar level order problem can be solved with BFS
Bottomup Zigzag Rightview Right next pointer Some Binary Tree basic tools are useful like MaxDepth, MinDepth, Height, SameTree, isSymmetric isBalanced can be speeded up with the help of
没有评论:
发表评论