Vidyalelo
Data Structure · all questions

Binary Search Trees(B Tree)
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

275

Questions

7/14

Page

Pick an option on a question to see the right answer and solution.

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

Select an option to see the answer and solution.

What must be the missing logic below so as to print mirror of a tree as below as an example?
Binary Search Trees(B Tree) mcq question image

if(rootnode):
  mirror(rootnode-->left)
  mirror(rootnode-->right)
 
  //missing
 
end

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

Is partitioning method used by Tango Tree.

Select an option to see the answer and solution.

For the tree below, write the pre-order traversal.
Binary Search Trees(B Tree) mcq question image

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

What is the time complexity of level order traversal?

Select an option to see the answer and solution.

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?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

What is the maximum height of an AVL tree with p nodes?

Select an option to see the answer and solution.

The maximum number of nodes in a tree for which post-order and pre-order traversals may be equal is . . . . . . . .

Select an option to see the answer and solution.

Figure below is a balanced binary tree. If a node inserted as child of the node R, how many nodes will become unbalanced?
Binary Search Trees(B Tree) mcq question image

Select an option to see the answer and solution.

In a full binary tree if there are L leaves, then total number of nodes N are?

Select an option to see the answer and solution.

Why the below pseudo code where x is a value, wt is weight factor and t is root node can't insert?
WeightBalanceTreeNode insert(int x, int wt, WeightBalanceTreeNode k) :
 
   if (k == null)
        k = new WeightBalanceTreeNode(x, wt, null, null)
   else if (x < t.element) :
 
        k.left = insert (x, wt, k.left)
        if (k.left.weight < k.weight)
            k = rotateWithRightChild (k)
 
    else if (x > t.element) :
 
        k.right = insert (x, wt, k.right)
        if (k.right.weight < k.weight)
            k = rotateWithLeftChild (k)

Select an option to see the answer and solution.

Can a tree stored in an array using either one of inorder or post order or pre order traversals be again reformed?

Select an option to see the answer and solution.

Is it true that splay trees have O(logn) amortized complexity ?

Select an option to see the answer and solution.

What is the space complexity of a treap algorithm?

Select an option to see the answer and solution.

Why we need to a binary tree which is height balanced?

Select an option to see the answer and solution.