Hexaware Technologies interview question

To sort the given array was one of my technical question