What is the worst-case time complexity of Quick Sort?
O(n log n)
O(n)
O(n²)
O(log n)
Answer and explanation
Quick Sort's worst case O(n²) occurs when the pivot is always the smallest or largest element (e.g., already sorted array with first element as pivot). Average case is O(n log n).
