How To Sort An Array Based Representation