Current list_sort has bug in it, which will result in infinite recursions and generate Segmentation Fault, it turns out that some edge condition is not handled properly.
Besides, current list_sort is really hard to understand.
While the new quick sort (list_qsort) is easy to understand and bug-free, and it's a bit slower only the data set is small, otherwise it's not slower than current in-place version.
And the test cases are really simple, so I devise some complicated ones.
Current list_sort has bug in it, which will result in infinite recursions and generate Segmentation Fault, it turns out that some edge condition is not handled properly.
Besides, current list_sort is really hard to understand.
While the new quick sort (list_qsort) is easy to understand and bug-free, and it's a bit slower only the data set is small, otherwise it's not slower than current in-place version.
And the test cases are really simple, so I devise some complicated ones.