A binary search tree is obtained by inserting the words "Mathematics", "Physics", "Geography", "Zoology", "Metrology", "Geology", "Psychology" and "Chemistry" in order. Words are compared by dictionary order. Arrange the following words in increasing order of their level in the tree.
A. Mathematics
B. Zoology
C. Psychology
D. Physics
Choose the correct answer from the options given below:
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: C. A, D, B, C
Explanation
Inserting in order: "Mathematics" becomes the root (level 0). "Physics" > "Mathematics" goes right (level 1); "Geography" "Mathematics", > "Physics" goes right of Physics (level 2). "Metrology" > "Mathematics" but "Geography" goes right of Geography (level 2). "Psychology" > "Mathematics", > "Physics", A, D, B, C.More Data Structures and Algorithms questions
- In open addressing, how are collisions typically resolved?
- What is the height of the binary search tree obtained by inserting the numbers 40, 60, 50, 37, 52, 15, 8, 22 in the given order
- Match the LIST-I with LIST-II. LIST-I (Data structure) LIST-II (Characteristics) A. Stack I. First-In-First-Out (FIFO) order B. Queue II. L…
- How will the following min-heap appear on inserting the key 32? Original min-heap (level order): 5, 10, 25, 30, 40, 50, 60, 70, 80, 90 (roo…
- Consider the infix expression Q : ((A + B) ∗ D) ↑ (E − F). The equivalent postfix expression of Q is
- Which of the following trees are height balanced? A. Binary Search Tree B. AVL Tree C. Red-Black Tree D. B Tree Choose the correct answer f…