Copy/Clone Linked List with Random Pointer | 2 Methods

Published: 09 January 2022
on channel: Fit Coder
1,377
15

In this video, I have explained how to copy/clone a linked list with next and random pointers.
Given a doubly linked 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.
Construct a copy of the list and return the head of the copied linked list.

Source code: https://github.com/fit-coder/fitcoder...

00:00 Introduction
00:22 Problem explanation
02:30 Method 1 (Using extra space)
13:36 Method 2 (Without extra space)
24:46 Implementation

-------------------------------------------------------------
I live in New Delhi and love explaining programming concepts. I have done M.Tech(BITS Pilani) + B.Tech(PEC, Chandigarh) in Computer Science and am currently working as a software engineer in a MNC.
If you like my content, please like, share my videos and subscribe to the channel.
-------------------------------------------------------------

For Linked List tutorials, please refer to the below playlist:
   • Linked List  

For Binary tree tutorials, please refer to the below playlist:
   • Tree Data Structures  

For Binary search tree tutorials, please refer to the below playlist:
   • Binary Search Tree  

For in-depth Graph theory and implementation details, please refer to the below playlist:
   • Graph Algorithms  

#DataStructure,#LinkedList,#FitCoder,#Algorithm,#competitiveprogramming,#faang,#codinginterview


On this page of the site you can watch the video online Copy/Clone Linked List with Random Pointer | 2 Methods with a duration of hours minute second in good quality, which was uploaded by the user Fit Coder 09 January 2022, share the link with friends and acquaintances, this video has already been watched 1,377 times on youtube and it was liked by 15 viewers. Enjoy your viewing!