Q-Sort

there is some problem in this code, can anyone help me?