First, solve the problem. Then, write the code. John Johnson

Split a Circular Linked List into two halves

Language Java | Level Intermediate | Category Data structure | September 5, 2015 11:03 pm


Data structure Description

Circular linked list is a linked list in which the head node previous pointer points to the tail node.

Write a program to split the circular linked list into two halves linked list. Two lists should have split with equal size. If the list has an odd number of elements, split with two nearly half lists.


Output

   					 

Create circular linked list which head pointer next node point to tail node of the list
Display circular linked list: 1->2->3->4->5->6->7
Split the circular list 
Display first list: 1->2->3->4
Display second list: 5->6->7

				    

Comments


No comments available!

Please login to add comments.