Question:
Write a program to implement the insertion operation and deletion operation in a doubly linked list.?
Upendra P
2007-04-18 05:11:22 UTC
Write a program to implement the insertion operation and deletion operation in a doubly linked list.?
Three answers:
2007-04-18 05:15:19 UTC
Good luck doing your own homework!
Meg W
2007-04-18 05:17:52 UTC
You really need to either do this yourself or drop out of the data structures class. This is fundamental. If you don't understand doubly linked lists, you're going to be lost when you get to ISAM and beyond.



Doubly linked lists are not complex. If you can handle a regular linked list, remember you need to go "one step beyond" and keep track of the backlink when inserting/deleting the forward one. Draw it out on a sheet of paper and you'll see.... the extension is pretty easy.
frerichs
2016-12-29 11:30:27 UTC
With a stack, you have a pointer to the appropriate of the stack. Assuming that your stack grows up in memory: To insert an ingredient, increment the stack pointer, and pass the object to the area on the hot pointer fee. To delete an ingredient, decrement the pointer. With lists think you have a doubly related checklist with components A and C and you want to insert B between them. Allocate a node for B. Set A's next pointer to point to B set B's previous pointer to point to A. Set B's next pointer to point to C, set C's previous pointer to point to B. To delete node B, set A next to point to C and C Prev to point to A.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...