How to Sort Linked List ?
[Question]: Given Head of singly linked list return a sorted linkedlist head(ascending order.)Criteria: -TC should O(n) SC: O(1) Input: head = [4,2,1,3] Output: [1,2,3,4] #Approach : We can use merge sort: which work on divide & conquer
How to Sort Linked List ? Read More »