31. 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
. root property is black
. every leaf is black
. children of red node are black
. all leaves have same black
32. What is the maximum height of an AVL tree with p nodes?
33. The maximum number of nodes in a tree for which post-order and pre-order traversals may be equal is . . . . . . . .
34. Figure below is a balanced binary tree. If a node inserted as child of the node R, how many nodes will become unbalanced?
/1725256540-57-3.png)
35. In a full binary tree if there are L leaves, then total number of nodes N are?
36. 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)
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)
37. Can a tree stored in an array using either one of inorder or post order or pre order traversals be again reformed?
38. Is it true that splay trees have O(logn) amortized complexity ?
39. What is the space complexity of a treap algorithm?
40. Why we need to a binary tree which is height balanced?
Read More Section(Binary Search Trees(B Tree))
Each Section contains maximum 100 MCQs question on Binary Search Trees(B Tree). To get more questions visit other sections.