Copy a linked list with next and arbit pointer You are given a Double Link List with one pointer of each node pointing to the next node just like in a single link list. The second pointer however CAN point to any node in the list and not just the previous node. Now write a program in O(n) time to duplicate this list. That is, write a program which will create a copy of this list. Let us call the second pointer as arbit pointer as it can point to any arbitrary node in the linked list.
Read full article from Copy a linked list with next and arbit pointer - GeeksforGeeks
No comments:
Post a Comment