Finding the middle node of a singly linked list || LeetCode 876

Опубликовано: 17 Май 2026
на канале: Riyafa Abdul Hameed
253
2

This is the solution for the leetcode problem 876. Middle of the Linked List https://leetcode.com/problems/middle-...


This is inspired by the Cracking the Coding Interview book by Gayle Laakmann McDowell
This is based on chapter 2 Linked Lists, the runner approach

Purchase the book here: https://amzn.to/2ze5Vgf



In this solution we approach the problem using the slow pointer and fast pointer concept. Another way to achieve the same is by first finding the length of the linked list and then finding the middle element which will also take O(n) time though we have to traverse the list twice.



 Find the code solution here: https://leetcodevideosolutions.blogsp...