Tuesday, 19 April 2016
Week 8
This week we looking at binary trees with greater depth. What I found very interesting was the different orders of traversal. Pre-order visit is when you visit each left sub-tree before visiting the right. Post-order visit is when you visit each node after you visit it's subtrees. Level-order visit is when you visit the nodes at each level of subtree before moving onto the next. These methods can be used for different types of data manipulation in different circumstances. When searching for a node it might be more efficient to use level-order search if the node is likely to be one of the first few nodes.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment