Redirecting to
NADOS

Copy Linkedlist With Random Pointers

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

1. Given a singly linklist with an additional random pointer which could point to any node in the list or NULL.
2. Return a deep copy of the list.
3. For More Details watch Video.
Input Format
input is handle for you
Output Format
output is handle for you.
Question Video
Constraints
0 <= N <= 10^6
Sample Input
5
7 -1
15 0
18 4
10 2
5 0
Sample Output
(7, -1) (15, 7) (18, 5) (10, 18) (5, 7) 


  • Asked in Companies
  • Related Topics






Video Solution

Code Solution

Run
 
Run
Id Name