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 does the below definations convey? i. A binary tree is balanced if for every node it is gonna hold that the number of inner nodes in the left subtree and the number of inner nodes in the right subtree differ by at most 1. ii. A binary tree is balanced if for any two leaves the difference of the depth is at most 1.

  1. A. weight balanced and height balanced tree definations
  2. B. height balanced and weight balanced tree definations
  3. C. definations of weight balanced tree
  4. D. definations of height balanced tree
Report Error

Which operation is used to break a preferred path into two sets of parts at a particular node?

  1. A. Differentiate
  2. B. Cut
  3. C. Integrate
  4. D. Join
Report Error

In which of the following self - balancing binary search tree the recently accessed element can be accessed quickly?

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

Consider the below left-left rotation pseudo code where the node contains value pointers to left, right child nodes and a height value and Height() function returns height value stored at a particular node. avltree leftrotation(avltreenode z): avltreenode w =x-left x-left=w-right w-right=x x-height=max(Height(x-left),Height(x-right))+1 w-height=max(missing)+1 return w What is missing?

  1. A. Height(w-left), x-height
  2. B. Height(w-right), x-height
  3. C. Height(w-left), x
  4. D. Height(w-left)
Report Error

What is the speciality of cartesian sorting?

  1. A. it sorts partially sorted set of data quickly
  2. B. it considers cartesian product of elements
  3. C. it sorts elements in less than O(logn)
  4. D. it is a self balancing tree
Report Error

How many top trees are there in a tree with single vertex?

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

The post-order traversal of a binary tree is O P Q R S T. Then possible pre-order traversal will be . . . . . . . .

  1. A. T Q R S O P
  2. B. T O Q R P S
  3. C. T Q O P S R
  4. D. T Q O S P R
Report Error

If binary trees are represented in arrays, what formula can be used to locate a left child, if the node has an index i?

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

How many edges does a leaf cluster contain?

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

What is the time complexity for the initialization of top tree?

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

Consider a weight balanced tree such that, the number of nodes in the left sub tree is at least half and at most twice the number of nodes in the right sub tree. The maximum possible height (number of nodes on the path from the root to the farthest leaf) of such a tree on k nodes can be described as

  1. A. log2 n
  2. B. log4/3 n
  3. C. log3 n
  4. D. log3/2 n
Report Error

What is the range of β in finding the length of the longest path in a randomized binary search tree?

  1. A. (-1, 0)
  2. B. (1, 0)
  3. C. (0, 5)
  4. D. (0, 1)
Report Error