Find the middle of a Linked List
EasyGiven a singly linked list, write a function that returns the middle node.
For example, given the head of the input linked list:
(3) -> (9) -> (7)
Your function should return the node with
9
.You can assume that the list has an odd number of nodes.
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