Sort a N * N matrix with QuickSort