Menu

Trees Questions

MCQ
91.
The number of edges from the root to the node is called __________ of the tree.
forum Discussion
MCQ
92.
The number of edges from the node to the deepest leaf is called _________ of the tree.
forum Discussion
MCQ
93.
Which of the following is not an advantage of trees?
forum Discussion
MCQ
94.
What is an AVL tree?
forum Discussion
MCQ
95.
What is the maximum height of an AVL tree with p nodes?
forum Discussion
MCQ
96.
To restore the AVL property after inserting a element, we start at the insertion point and move towards root of that tree. is this statement true?
forum Discussion
MCQ
97.
Given an empty AVL tree, how would you construct AVL tree when a set of numbers are given without performing any rotations?
forum Discussion
MCQ
98.
What maximum difference in heights between the leafs of a AVL tree is possible?
forum Discussion
MCQ
99.
Consider the pseudo code below.
Does the below code can check if a binary search tree is an AVL tree?

int avl(binarysearchtree root):
     if(not root)
       return 0
     left_tree_height = avl(left_of_root)
 
     if(left_tree_height== -1) 
       return left_tree_height
 
     right_tree_height= avl(right_of_root)
 
     if(right_tree_height==-1)
       return right_tree_height
forum Discussion
MCQ
100.
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.
What is missing?

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
forum Discussion