Aspire Faculty ID #12096 · Topic: CUET 2025 · Just now
CUET 2025

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)}} \]

Previous 10 Questions — CUET 2025

Nearest first

Next 10 Questions — CUET 2025

Ascending by ID
Ask Your Question or Put Your Review.

loading...