Write an algorithm to split a circular linked list two linked list with equal no of nodes
Anonymous
Why not this approach? 1. First find the length of the circular linked list. Let it be 'n'. 2. Then define functions as shown below. LinkedList first = toList(head, 0, len/2); LinkedList second = toList(head, (len/2)+1, len); The first argument denotes the head of circular linked list, second denotes the start and the last one denotes the tail/end of the list
Check out your Company Bowl for anonymous work chats.