Implementing quicksort algorithm

前端 未结 7 1295
走了就别回头了
走了就别回头了 2021-02-01 19:48

I found quicksort algorithm from this book

\"\"

This is the algorithm

QUICKSORT (A, p, r)
i         


        
7条回答
  •  灰色年华
    2021-02-01 20:11

    In addition to Deestan's answer, you also have this wrong:

    for (int j = low; j < high-1; j++)
    

    It should be:

    for (int j = low; j < high; j++)
    

提交回复
热议问题