Pre-order Traversal: Exercise

  • Trace pre-order traversal.

Consider this BST

Exercise Carry out the pre-order traversal.

Hint: Pre-order strategy states for every node, visit it, then visit its left subtree, then visit its right subtree.

Solution

7,2,4,5,13,10,8,11,15,14,17 7, 2, 4, 5, 13, 10, 8, 11, 15, 14, 17