The original Binary Search Tree
1)5 3 4 9 12 7 8 6 20
This sequence will produce the same binary tree as the one shown above. As the binary tree produce by the sequence is shown below:
2)5 9 3 7 6 8 4 12 20
This sequence will produce the same binary tree as the one given above. As the binary tree produce by the sequence is shown below
3)5 9 7 8 6 12 20 3 4
This sequence will produce the same binary tree as the one given above. As the binary tree produce by the sequence is shown below
4)5 9 7 3 8 12 6 4 20
This sequence will produce the same binary tree as the one given above. As the binary tree produce by the sequence is shown below
5) 5 9 3 6 7 8 4 12 20
This sequence will not produce the same binary tree as the one given above. As the binary tree produce by the sequence is shown below
Therefore, the answer to this question in sequence number 5.
Comments
Leave a comment