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.

If A ꓵ B (A and B are two clusters) is a singleton set then it is a Merge able cluster.

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

AA-Trees makes more rotations than a red-black tree.

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

Disadvantages of linked list representation of binary trees over arrays?

  1. A. Randomly accessing is not possible
  2. B. Extra memory for a pointer is needed with every element in the list
  3. C. Difficulty in deletion
  4. D. Random access is not possible and extra memory with every element
Report Error

What is wrong with below code for inorder traversal of inorder threaded binary tree: inordertraversal(threadedtreenode root): threadedtreenode q = inorderpredecessor(root) while(q!=root): q=inorderpredecessor(q) print q.data

  1. A. inordersuccessor instead of inorderpredecessor must be done
  2. B. code is correct
  3. C. it is code for post order
  4. D. it is code for pre order
Report Error

What is the space complexity of the post-order traversal in the recursive fashion? (d is the tree depth and n is the number of nodes)

  1. A. O(1)
  2. B. O(nlogd)
  3. C. O(logd)
  4. D. O(d)
Report Error

Is the below tree representation of 50, 100,400,300,280 correct way to represent cartesian tree?

  1. A. true
  2. B. false
Report Error

Advantages of linked list representation of binary trees over arrays?

  1. A. dynamic size
  2. B. ease of insertion/deletion
  3. C. ease in randomly accessing a node
  4. D. both dynamic size and ease in insertion/deletion
Report Error

For a binary tree the first node visited in in-order and post-order traversal is same.

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

A full binary tree can be generated using . . . . . . . .

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

What must be the missing logic in place of missing lines for finding sum of nodes of binary tree in alternate levels? //e.g:-consider -complete binary tree:-height-3, [1,2,3,4,5,6,7]-answer must be 23 n=power(2,height)-1; //assume input is height and a[i] contains tree elements for(i=1;i<=n;) { //present level is initialized to 1 and sum is initialized to 0 for(j=1;j<=pow(2,currentlevel-1);j++) { sum=sum+a[i]; i=i+1; } //missing logic }

  1. A. i=i+pow(2,currentlevel); currentlevel=currentlevel+2; j=1
  2. B. i=i+pow(2,currentlevel); currentlevel=currentlevel+2; j=0
  3. C. i=i-pow(2,currentlevel); currentlevel=currentlevel+2; j=1
  4. D. i=i+pow(2,currentlevel); currentlevel=currentlevel+1; j=1
Report Error

How many different shapes does maintenance of AA-Tree need to consider?

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

A treap is a cartesian tree with . . . . . . . .

  1. A. additional value, which is a priority value to the key generated randomly
  2. B. additional value, which is a priority value to the key generated sequentially
  3. C. additional heap rule
  4. D. additional operations like remove a range of elements
Report Error