![]() |
|
#1
|
|||
|
|||
|
I am having some problems with writing a C program to generate a linked list from 0 to 9 and be able to INSERTE and DELETE from it. Say delete 5; and inserte 11 between the created linked list
|
|
#2
|
||||||||||||
|
||||||||||||
|
Google. C++ LL. That's more detailed than I think it needs to be.
__________________
Look at the delete beginning node and delete end node functions. A combination of both does a general delete. Find the node you want to delete. use the begin node delete method on it. Find the node before the node (it's the one that points to this one as next) that you want to delete (one way link list means search from beginning) and make it point to the new next node. Insert is easy. Find where you want to insert. Create the new node. Make node before insertion point to it, make new node point to what the before node pointed to before. Done. My System: Toshiba Satellite A200-28P
|