Remove node from a Linked List
EasyYou're given a reference to a node in a singly linked list of numbers.
Write a function that removes that node from its linked list.
For example, given the linked list:
(1) -> (5) -> (7) -> (2)
If your function is passed a reference to the second node with the data
5
as an input, the linked list should be become:(1) -> (7) -> (2)
The input node can be any node in the list except the tail.
Try it first
Solution
8 Essential Linked Lists Coding Interview Problems
Master Linked Lists by trying the coding challenges below.
- 1.Insert NodeEasy
- 2.Remove NodeEasy
- 3.Find the MiddleEasy
- 4.Add Linked ListsEasy
- 5.Reverse Linked ListMedium
- 6.Detect CycleMedium
- 7.Merge Linked ListsMedium
- 8.Pivot Linked ListHard