192k views
5 votes
You wish to traverse a binary search tree in sorted order using pre order traversal. Arrange the following actions in the correct order to accomplish this. I Print the right subtree recursively II Print the root III Print the left subtree recursively

1 Answer

4 votes

Answer:

II Print the root

III Print the left subtree recursively

I Print the right subtree recursively

Step-by-step explanation:

The question illustrates binary search in data structure.

When preorder is applied to a binary search, the search starts by visiting the root node, then proceed to the visiting the left most nodes and finally, the left nodes will be visited.

Using the above illustration, the arrangement of the actions in ascending order is: II, III and I

User Ahmed Nabil
by
4.8k points