quicksort algorithm

profilezchang91

 (1) Please generate an array with 11 elements, which is the best case at the first iteration of QUICKSORT algorithm and then is the worst case for both subarrays at the second iteration of QUICKSORT algorithm. The last element is used as Pivot.

 (2) Please explain your answer is the worst case and the best case for the first and second iterations.

  2. Please sort the input array [9 -9 15 35 -1 14 20 7] using QUICKSORT algorithm to output an increasing order array. The last element is used as Pivot (please show detailed steps for full credits)  

    • 4 years ago
    • 10
    Answer(1)

    Purchase the answer to view it

    blurred-text
    NOT RATED
    • attachment
      Document1.docx