Looking for hosting? Read HostGator review to find 7 arguments in support of HostGator.
Binary search tree. List values in order
To construct an algorithm listing BST's values in order, let us recall binary search tree property:
- left subtree of a node contains only values lesser, than the node's value;
- right subtree of a node contains only values greater, than the node's value.
- get values in order from left subtree;
- get values in order from right subtree;
- result for current node is (result for left subtree) join (current node's value) join (result for right subtree).
Example





Recommended books
- Cormen, Leiserson, Rivest. Introduction to algorithms. (Theory)
- Aho, Ullman, Hopcroft. Data Structures and Algorithms. (Theory)
- Robert Lafore. Data Structures and Algorithms in Java. (Practice)
- Mark Allen Weiss. Data Structures and Problem Solving Using C++.(Practice)
| Previous: Remove operation on BST |
Partners Ads http://www.distinctivedoors.co.uk/ Medifast Coupon