Morgan Stanley interview question

Write code for a binary sort.