iOS

How to create deep copy of linked list who has random pointer

[Question]: Create a deep copy of the linked list. which consist of exactly n fresh new nodes, where each new node has its value set to the value of its corresponding original node. Both the next and random pointer of the new nodes should point to new nodes in the copied list such that the pointers in the original list and copied list represent …

How to create deep copy of linked list who has random pointer Read More »

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