Absolution difference between left sub-tree and right sub-tree is bigger than 1
A good video can be found here https://www.youtube.com/watch?v=TWDigbwxuB4
2. What is BFS:
scan level by level
3. What is DFS:
go down first then go back.
we have preorder, inorder and postorder. pre/in/post describe where is the root node.
1
2 3
4 5 6 7
preorder: 1, 2, 4, 5, 3, 6, 7
inorder: 4, 2, 5, 1, 6, 3, 7
postorder: 4, 5, 2, 6, 7, 3, 1
No comments:
Post a Comment