Cognizant interview question

Write a code for heapsort