... programming requires more concentration than other activities. It's the reason programmers get upset about quick interruptions' - such interruptions are tantamount to asking a juggler to keep three balls in the air and hold your groceries at the same time. Steve McConnell

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.



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



No comments available!

Please login to add comments.