J.P. Morgan interview question

Simple sorting algorithm.