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

Reverse Doubly Link List.

[Question] Given a Doubly Linked List, the task is to reverse the given Doubly Linked List. Here we can can solve by two approach #1 Iterative #2 Recursive For information about usage visit my Githhub Page

Odd Even Linked List

[Question] Given the head of a singly linked list, group all the nodes with odd indices together followed by the nodes with even indices, and return the reordered list. The first node is considered odd, and the second node is even, and so on. You must solve the problem in O(1) extra space complexity and O(n) time complexity. Example 1: Input: head = [1,2,3,4,5] Output: [1,3,5,2,4]