Cognizant interview question

Question from Data structure. like write a code to sort a linked list.