English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

1 answers

To insert
Allocate some memory.
Now find the insert point ( the item before).
The list item before must be set to point to the address of new memory location and the new item must now contain the memory location from the item before.

To delete
Locate the item before
Locate the item to be deleted.
The item before must now contain the memory location from the item to be deleted.
De-allocate the item to be deleted.

2007-06-29 04:15:19 · answer #1 · answered by AnalProgrammer 7 · 0 0

Basically all you need to do is to change the pointers of previous and next nodes (unless its the first or last, then you need to change only one node, so yeah keep a condition to check the current position)...
you can search online and will find plenty of examples...
which langauge are you using btw?

2007-06-29 14:22:59 · answer #2 · answered by Anonymous · 0 0

fedest.com, questions and answers