Commerce

Binary Search TreesB Tree MCQs

Practice Binary Search TreesB Tree MCQs for competitive exams.

Binary Search TreesB Tree MCQs

Practice questions from this topic.

What is the result of a successful search operation in a BST when the searched element is not present?

  1. A. The search will return the node containing the element.
  2. B. The search will return the parent node of the searched element.
  3. C. The search will return a null pointer.
  4. D. The search will return the root node.
Report Error

In a BST, how do you find the minimum value node?

  1. A. Traverse to the leftmost node from the root.
  2. B. Traverse to the rightmost node from the root.
  3. C. Find the node with the maximum value.
  4. D. Find the node with the second highest value.
Report Error

What is the primary characteristic of a node in a Binary Search Tree (BST)?

  1. A. It has a value greater than all values in its left subtree and less than all values in its right subtree.
  2. B. It is the root of the tree.
  3. C. It has at least one child.
  4. D. It is the only node in the tree.
Report Error

In a Binary Search Tree, what is the term for the node that has no children?

  1. A. Root
  2. B. Leaf
  3. C. Parent
  4. D. Internal node
Report Error

What is the purpose of rotations in a Binary Search Tree?

  1. A. To maintain balance and ensure logarithmic height in self-balancing trees.
  2. B. To optimize search operations.
  3. C. To sort elements in the tree.
  4. D. To update node values.
Report Error

What happens when you delete a node with two children from a BST?

  1. A. The node is replaced by its predecessor or successor, and then the predecessor or successor is removed.
  2. B. The node is simply removed.
  3. C. The node's right child replaces it.
  4. D. The node is moved to the root.
Report Error

Which of the following operations can be performed in O(log n) time on a balanced Binary Search Tree?

  1. A. Insertion
  2. B. Deletion
  3. C. Search
  4. D. All of the above
Report Error

How can you determine if a Binary Tree is a Binary Search Tree (BST)?

  1. A. Verify if all nodes in the left subtree are less than the root and all nodes in the right subtree are greater than the root.
  2. B. Check if the tree is balanced.
  3. C. Ensure all nodes have exactly two children.
  4. D. Verify the height of the tree.
Report Error

What is the maximum number of children a node in a Binary Search Tree (BST) can have?

  1. A. 1
  2. B. 2
  3. C. 3
  4. D. Any number
Report Error

Which traversal method of a BST will produce a sorted sequence of node values?

  1. A. Inorder
  2. B. Preorder
  3. C. Postorder
  4. D. Level-order
Report Error

What is the time complexity of searching for an element in a Binary Search Tree (BST) in the worst case?

  1. A. O(1)
  2. B. O(log n)
  3. C. O(n)
  4. D. O(n log n)
Report Error