GfG QA is closing soon... Please refer PRACTICE or GfG now on wards !!

Build A Singly Linked List From Split Nodes

Suppose I have split a linked list by each node, now I have a list in random order:

A-B, C-D, B-C, D-E

I have to build a linked list back out of it like


what approach should i follow.?

2 cases:

1. i have all the elements in the list 

2. elements are coming in a stream


asked Jan 15, 2017 by Willubelieve Mee