Algorithm · Apple · Medium
Copy List with Random Pointer Medium · Topics · Company Tags · Hints You are given a singly linked list in which every node holds an integer val, a next pointer to the following node, and a random pointer that can reference any node in the list — or be null. Write a function that returns a deep copy of the entire list. The new list must be built from entirely new node objects. For every original node, the corresponding copy must contain the same val. In addition: The next…
Checking your access…