Balanced Trees: AVL and Red-Black Trees - Implementations in C++ - Case Studies

Download Q&A
Q. In a Red-Black tree, what must be true about the children of a red node?
  • A. They must be red.
  • B. They must be black.
  • C. They can be either color.
  • D. They must be leaf nodes.
Q. What happens to the balance factor of an AVL tree after an insertion?
  • A. It remains unchanged.
  • B. It can become -2 or 2.
  • C. It can only be -1, 0, or 1.
  • D. It is always reset to 0.
Q. What is the time complexity of inserting an element in an AVL tree?
  • A. O(n)
  • B. O(log n)
  • C. O(n log n)
  • D. O(1)
Q. Which of the following operations is guaranteed to be O(log n) in both AVL and Red-Black trees?
  • A. Insertion
  • B. Deletion
  • C. Searching
  • D. All of the above
Q. Which rotation is performed when a node is inserted into the left subtree of the left child in an AVL tree?
  • A. Right Rotation
  • B. Left Rotation
  • C. Left-Right Rotation
  • D. Right-Left Rotation
Showing 1 to 5 of 5 (1 Pages)
Soulshift Feedback ×

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

Not likely Very likely