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.

Why do we impose restrictions like . root property is black . every leaf is black . children of red node are black . all leaves have same black

  1. A. to get logarithm time complexity
  2. B. to get linear time complexity
  3. C. to get exponential time complexity
  4. D. to get constant time complexity
Report Error

What are null nodes filled with in a threaded binary tree?

  1. A. inorder predecessor for left node and inorder successor for right node information
  2. B. right node with inorder predecessor and left node with inorder successor information
  3. C. they remain null
  4. D. some other values randomly
Report Error

Self - balancing binary search trees have a much better average-case time complexity than hash tables.

  1. A. True
  2. B. False
Report Error

If the tree is not a complete binary tree then what changes can be made for easy access of children of a node in the array?

  1. A. every node stores data saying which of its children exist in the array
  2. B. no need of any changes continue with 2w and 2w+1, if node is at i
  3. C. keep a seperate table telling children of a node
  4. D. use another array parallel to the array with tree
Report Error

What is the time complexity of level order traversal?

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

What is the time complexity for creating a new node and then performing concatenation in the rope data structure?

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

For the tree below, write the pre-order traversal.

  1. A. 2, 7, 2, 6, 5, 11, 5, 9, 4
  2. B. 2, 7, 5, 2, 6, 9, 5, 11, 4
  3. C. 2, 5, 11, 6, 7, 4, 9, 5, 2
  4. D. 2, 7, 5, 6, 11, 2, 5, 4, 9
Report Error

Is partitioning method used by Tango Tree.

  1. A. True
  2. B. False
Report Error

What is the maximum number of children that a binary tree node can have?

  1. A. 0
  2. B. 1
  3. C. 2
  4. D. 3
Report Error

What must be the missing logic below so as to print mirror of a tree as below as an example? if(rootnode): mirror(rootnode-->left) mirror(rootnode-->right) //missing end

  1. A. swapping of left and right nodes is missing
  2. B. swapping of left with root nodes is missing
  3. C. swapping of right with root nodes is missing
  4. D. nothing is missing
Report Error

Which of the following trees is similar to that of an AA-Tree?

  1. A. Splay Tree
  2. B. B+ Tree
  3. C. AVL Tree
  4. D. Red-Black Tree
Report Error

What does the following piece of code do? public void func(Tree root) { func(root.left()); func(root.right()); System.out.println(root.data()); }

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