MCQ1 mark
The worst case running time to search for an element in a balanced binary search tree with elements is
Single correct
Answer key coming soon
GATE CSE previous year questions · Programming & Data Structures
Single correct
Answer key coming soon
height(root) to compute the height of a binary tree rooted at the tree pointer root.
int height (treeptr n)
{ if (n == NULL) return -1;
if (n -> left == NULL)
if (n -> right == NULL) return 0;
else return [B1] ; // Box 1
else { h1 = height (n -> left);
if (n -> right == NULL) return (1+h1);
else { h2 = height (n -> right);
return [B2] ; // Box 2
}
}
}
The appropriate expressions for the two boxes B1 and B2 areSingle correct
Answer key coming soon