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.

Which of the following is an advantage of balanced binary search tree, like AVL tree, compared to binary heap?

  1. A. insertion takes less time
  2. B. deletion takes less time
  3. C. searching takes less time
  4. D. construction of the tree takes less time than binary heap
Report Error

What is the time complexity for the update cost on auxiliary trees?

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

Which of the following pair's traversals on a binary tree can build the tree uniquely?

  1. A. post-order and pre-order
  2. B. post-order and in-order
  3. C. post-order and level order
  4. D. level order and preorder
Report Error

Which of the below statements are true? i. Cartesian tree is not a height balanced tree ii. Cartesian tree of a sequence of unique numbers can be unique generated

  1. A. both statements are true
  2. B. only i. is true
  3. C. only ii. is true
  4. D. both are false
Report Error

What is missing in this logic of finding a path in the tree for a given sum (i.e checking whether there will be a path from roots to leaf nodes with given sum)? checkSum(struct bin-treenode *root , int sum) : if(root==null) return sum as 0 else : leftover_sum=sum-root_node-->value //missing

  1. A. code for having recursive calls to either only left tree or right trees or to both subtrees depending on their existence
  2. B. code for having recursive calls to either only left tree or right trees
  3. C. code for having recursive calls to either only left tree
  4. D. code for having recursive calls to either only right trees
Report Error

Two balanced binary trees are given with m and n elements respectively. They can be merged into a balanced binary search tree in . . . . . . . . time.

  1. A. O(m+n)
  2. B. O(mn)
  3. C. O(m)
  4. D. O(mlog n)
Report Error

What is inefficient with the below threaded binary tree picture?

  1. A. it has dangling pointers
  2. B. nothing inefficient
  3. C. incorrect threaded tree
  4. D. space is being used more
Report Error

Which type of data structure does rope represent?

  1. A. Array
  2. B. Linked List
  3. C. Queue
  4. D. Binary Tree
Report Error

Level order traversal of a tree is formed with the help of

  1. A. breadth first search
  2. B. depth first search
  3. C. dijkstra's algorithm
  4. D. prims algorithm
Report Error

Which of the following properties are obeyed by all three tree - traversals?

  1. A. Left subtrees are visited before right subtrees
  2. B. Right subtrees are visited before left subtrees
  3. C. Root node is visited before left subtree
  4. D. Root node is visited before right subtree
Report Error

How many orders of traversal are applicable to a binary tree (In General)?

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

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

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