quicksort algorithm in R