The keys 10, 20, 30, 40, 50 are inserted in that order into an empty, unbalanced binary search tree. What is the height of the resulting tree, counting edges on the longest path?
Correct answer D. 4
Subject / 421 questions
Page 2 of Programming multiple-choice questions with answers. Tap an option to check yourself.
Page 2 of 22
Correct answer D. 4
Correct answer C. 60
Correct answer D. O(log n)
Correct answer A. −1, 0 or +1
Correct answer A. A single left rotation; 20 becomes the root
Correct answer B. A left-right double rotation (left rotation at 10, then right rotation at 30)
Correct answer A. m − 1
Correct answer C. All data records are stored in the leaves, and the leaves are linked for sequential access
Correct answer B. [1, 4, 3, 10, 8, 7]
Correct answer C. [9, 4, 5, 1, 3, 2]
Correct answer A. 2i + 1 and 2i + 2
Correct answer C. O(n)
Correct answer B. [3, 4, 7, 10, 8]
Correct answer D. Queue
Correct answer C. Stack
Correct answer D. O(V²)
Correct answer D. A, B, D, E, F, C
Correct answer B. A, C, B, D, E
Correct answer C. A directed acyclic graph (DAG)
Correct answer B. 13