Sort:  

Exactly, if u can draw the graph, you can write the code.