quick sort with srand from the header stdlib