add randomized quick sort and fix a bug in previous quick sort

when we sort two partitioned array, we should not include the pivot, which
would cause a fault. say start is 5 and end is 6, we choose 6 as pivot and if
the array is sorted, we would jump into an infinite call loop of quick sort