Question: Suppose that the following elements are added in the specified order to an empty binary search tree: Kirk, Spock, Scotty, McCoy, Chekov, Uhuru, Sulu, Khaaaan!
Suppose that the following elements are added in the specified order to an empty binary search tree:
Kirk, Spock, Scotty, McCoy, Chekov, Uhuru, Sulu, Khaaaan!
Write the elements of the tree above in the order they would be seen by a pre-order, in-order, and post-order traversal.
Can someone explain how to create the tree? How do I decide if the name goes on the left or right branch? etc. Help is appreciated.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
