Redirecting to
NADOS

Middle Of A Linked List

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.

given a singly linked list with head node head, return a middle node of linked list.
if there is 2 mid node then return first mid node.
Input Format
1->2->3->4->5->6->7->null
1->2->3->4->5->6->null
Output Format
4->5->6->7->null
3->4->5->6->null
Question Video
Constraints
0 <= N <= 10^6
Sample Input
7
1 2 3 4 5 6 7
Sample Output
4 5 6 7 


  • Asked in Companies
  • Related Topics






Video Solution

Code Solution

Run
 
Run
Id Name