an exercise in writing various sorting algorithms