add the qsort function for ls1.c