Question
Consider a Binary Search Tree (BST) with the following
values inserted in sequence: 45, 32, 50, 15, 40, 47, 60. What will be the in-order traversal of this BST after all insertions?Solution
In-order traversal of a BST processes nodes in an ascending order because it visits the left subtree first, then the root, and finally the right subtree. After inserting the values in the specified order into the BST, performing an in-order traversal yields the nodes in the correct ascending order: 15, 32, 40, 45, 47, 50, 60. The traversal algorithm guarantees that every nodeβs left subtree is smaller, and the right subtree is larger, which ensures a sorted sequence. Why other options are wrong: B) This is the reverse order of an in-order traversal, visiting the largest element first. C) This option shows a pre-order traversal, which visits the root node first before the subtrees. D) This sequence incorrectly mixes elements from the left and right subtrees, violating the order property. E) This option represents a reverse post-order traversal, starting with the deepest right-side elements.
Pipes A and B can fill an empty tank in 20 hours and 24 hours, respectively, while pipe C can drain the full tank in "x" hours. If all three pipes (A, B...
Two inlet pipes 'A' and 'B' can fill an empty tank in 30 minutes and 40 minutes, respectively. Another outlet pipe 'C' can empty the tank in 120 minutes...
A, B and C are three pipes connected to a tank. A and B together fill the tank in 30 hours, B and C together fill the tank in 40 hours. A and C together...
Pipe βAβ and pipe βBβ can fill a cistern in 30 minutes and 10 minutes respectively. Pipe βCβ alone can empty the cistern in 12 minutes. If a...
Two pipes M and N can fill a tank in 20 hours and 30 hours respectively. The pipes were opened together, but pipe N stopped working after sometime and t...
Pipe Y is 25% less efficient than pipe X. Together, pipes X and Y can fill a tank in 15 minutes. Pipe Z alone can empty the tank ...
In how many minutes can the faster Tap alone fill the tank, if Tap P and Q, working together, can fill the tank in 45 minutes and Tap P is three times f...
Tap A and Tap B fill a drum of volume 483 liters in 21 minutes. If their efficiencies are in the ratio x:y respectively and B alone takes to fill the ci...
- Pipe 'A' can fill a tank in 12 hours. Pipe 'B' is ____% as efficient as pipe 'A'. If both pipes are opened simultaneously, the tank will be completely full...
Pipe βAβ and pipe βBβ can fill a cistern in 18 minutes and 16 minutes respectively. Pipe βCβ alone can empty the cistern in 12 minutes. If a...