+ 1
Inserting at specific location in singly linked list.
In this code inserta() function is working but after that if we try to implement display() function the output is going in infinite loop. Other functions insertb() and inserte() are working fine with display (). https://code.sololearn.com/cVWClPYTz4uT/?ref=app
2 Réponses
+ 3
inserta will fail if you try to insert after first as ptr1 still points to the first node so the first two have a circular loop and the rest of the list is lost.
0
John Wells please take a look at this code.