Question:

Which of the following algorithms have time order of complexity?
• [A.] Insertion sort
• [B.] Worst case Search in Binary Search tree
• [C.] Insertion in Stack
• [D.] Quick sort worst case
Choose the correct answer from the options given below:

Show Hint

Constant time \(O(1)\) operations are always fastest; avoid confusing them with \(O(n)\) or \(O(n^2)\).
Updated On: Jun 5, 2026
  • C and D only
  • A and B only
  • A and C only
  • A and D only
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is D

Solution and Explanation

Concept: We analyze time complexities of different operations and identify those with higher (non-constant) complexity.

Step 1:
Insertion Sort
• Worst case complexity: \(O(n^2)\)
• Not constant → depends on input size

Step 2:
BST Worst Case Search
• Worst case: skewed tree
• Complexity: \(O(n)\)

Step 3:
Stack Insertion
• Push operation
• Constant time: \(O(1)\)

Step 4:
Quick Sort Worst Case
• Worst case occurs when pivot is poorly chosen
• Complexity: \(O(n^2)\)

Step 5:
Conclusion Higher complexity algorithms: \[ A\ (O(n^2)), \quad D\ (O(n^2)) \] \[ \boxed{(4)\ A \text{ and } D} \]
Was this answer helpful?
0
0