Reputation: 37
I was wondering about the preorder result of the following binary search tree, as Im not sure how to approach the right side of the tree. Thanks!
8
/ \
3 10
/ \ \
1 6 14
/ \ / /
0 2 4 13
Upvotes: 1
Views: 49
Reputation: 98
The result is [8, 3, 1, 0, 2, 6, 4, 10, 14, 13]. You can use this website: http://www.cs.armstrong.edu/liang/animation/web/BST.html to create your tree first, and then select preorder option to get the result.
Upvotes: 1