user840
user840

Reputation: 37

Preorder result for the following binary search tree

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

Answers (1)

Sanjay Thapa
Sanjay Thapa

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

Related Questions