📢 Too many exams? Don’t know which one suits you best? Book Your Free Expert 👉 call Now!


    Question

    In which case is QuickSort’s performance

    worst?
    A Random array Correct Answer Incorrect Answer
    B Already sorted array Correct Answer Incorrect Answer
    C Reverse sorted array Correct Answer Incorrect Answer
    D Both B and C Correct Answer Incorrect Answer
    E None of the above Correct Answer Incorrect Answer

    Solution

    QuickSort degrades to O(n²) when the pivot divides the array unevenly, such as in sorted or reverse-sorted arrays.

    Practice Next
    ask-question