| Article Index |
|---|
| Split list |
| Source code |
| Documentation |
| Test case & Cpmpatibilty |
| All Pages |
Introduction :
A linked list is data structure that consists of a sequence of data records such that in each record there field is a that contains a link to the next record in the sequence. Consider the following list which has 4 nodes in it. The fourth node point to NULL marking the end of the list. The 'header' pointer points to the first node. The list is split at second position as shown below

The pointer 'l1' also points to the first node. A temporary pointer 'temp' is made to traverse through the list till the required position is reached.

The pointer 'l2' is made to point to the node after temp. temp-> next is assigned NULL marking the end of first list. Thus, the given list is split into two.
| < Prev | Next > |
|---|




