Aspire's Library

A Place for Latest Exam wise Questions, Videos, Previous Year Papers,
Study Stuff for MCA Examinations - NIMCET

Previous Year Question (PYQs)



In case of Binary search tree which of the following procedure's running time is distinct among all 

1. TREE-SUCCESSOR (finds successor of the given node) 
2. TREE-MAXIMUM (finds the node with maximum value) 
3. INORDER- WALK (prints all elements of a tree in inorder manner) 
4. TREE-MINIMUM (finds the node with minimum value)





Solution

BST Procedure Time Complexities (MathJax):

  • 1. TREE-SUCCESSOR: \( O(h) \)
  • 2. TREE-MAXIMUM: \( O(h) \)
  • 4. TREE-MINIMUM: \( O(h) \)
  • 3. INORDER-WALK: \( \Theta(n) \)

Since \(O(h)\) differs from \( \Theta(n) \) and INORDER-WALK always visits all \(n\) nodes,

\[ \boxed{\text{Distinct running time: INORDER-WALK (Option 3)}} \]



Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

Ask Your Question or Put Your Review.

loading...