Copy the code here if you want to perform quicksort on a 2D array, using concise code and minimal extra variables.