Balanced Trees: AVL and Red-Black Trees - Higher Difficulty Problems

Download Q&A
Q. How many rotations are required in the worst case to balance an AVL tree after an insertion?
  • A. 1
  • B. 2
  • C. 3
  • D. 4
Q. What is the time complexity of inserting a node in an AVL tree?
  • A. O(1)
  • B. O(log n)
  • C. O(n)
  • D. O(n log n)
Q. Which of the following properties is NOT true for a Red-Black tree?
  • A. Every node is either red or black.
  • B. The root is always black.
  • C. All leaves (NIL nodes) are red.
  • D. Red nodes cannot have red children.
Q. Which traversal method can be used to obtain a sorted order of elements in a Red-Black tree?
  • A. Pre-order
  • B. Post-order
  • C. In-order
  • D. Level-order
Showing 1 to 4 of 4 (1 Pages)
Soulshift Feedback ×

On a scale of 0–10, how likely are you to recommend The Soulshift Academy?

Not likely Very likely