Skip to content
CampusEduX

Find Middle Node

Easyjavapythonccppjavascript

Find the middle node of a singly linked list. If the list has an even number of nodes, return the second of the two middle nodes.

Input Format

The first line contains an integer N. The second line contains N space-separated integers.

Output Format

Print the value of the middle node.

Related Problems

  • Create and Traverse a Linked List
    Easy · java, python, c, cpp, javascript
    Solve Problem
  • Insert at Beginning of Linked List
    Easy · java, python, c, cpp, javascript
    Solve Problem
  • Insert at End of Linked List
    Easy · java, python, c, cpp, javascript
    Solve Problem

Input (stdin)

Output

Run your code to see output here...