Quick sort algorithm (C classic example)