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

In a binary search tree, the worst case time complexity of inserting and deleting a key is:

Solution

• Insertion: To insert, we first locate the correct position. This requires searching the tree = height \(h\). Worst case: tree is skewed (\(h=n\)) → \(O(n)\).

• Deletion: To delete, we also search for the node (\(O(h)\)) and adjust pointers (constant). Worst case: \(h=n\). So, time = \(O(n)\).

✅ Therefore: \[ \text{Insertion: } O(n), \quad \text{Deletion: } O(n) \]

Previous 10 Questions — CUET 2025

Nearest first

Next 10 Questions — CUET 2025

Ascending by ID
Ask Your Question or Put Your Review.

loading...