Cognizant interview question

Sort an array space time complexity