Find middle node/element of a LinkedList in Java

Write a program to find/print middle element of a Linked list in Java using length of a linked list

Solution:

1)      Find the length of linked list.

2)      Print the middle of a linked list at (length/2) th node/element.

 Output:

 

Posted in data-structures and tagged , , .

Leave a Reply

Your email address will not be published. Required fields are marked *