answersLogoWhite

0


Best Answer

Presumably you have a situation like this:

Each node is an area in memory with (1) the address of the following node, (2) the address of the previous node, and (3) some more data.

Say the nodes are linked in alphabetical order and part of the list goes like this:

PrevNode

-> Data = "Cincinnati"

-> FrontPtr = address of "Cleveland"

-> BackPtr = address of "Amelia"

CurrNode

-> Data = "Cleveland"

-> FrontPtr = address of "Columbus"

-> BackPtr = address of "Cincinnati"

NextNode

-> Data = "Columbus"

-> FrontPtr = address of "Dayton"

-> BackPtr = address of "Cleveland"

...and you want to delete the middle one. Steps could be:

1. save the address of CurrNode as KillNode

2. copy CurrNode->FrontPtr (address of "Columbus") into

PrevNode->FrontPtr

3. copy CurrNode->BackPtr (address of "Cincinanti") into

NextNode->BackPtr

4. free up the space at the location named in KillNode

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a function to delete a specified node from linked list?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you write c program to delete source code after execution?

Use function unlink to erase files.


How do you write specified in a sentence?

The itinerary specified the times and dates for their vacation.


How do you write a Linux function that will go to any directory then ls and pwd on it?

WHAT I NEED DONE in .bash_profile define a function go_show, that willGo to a specific directoryPrint your current locationPrint the contents of your current directoryThe directory this function takes you to will be specified as an argument to the function on the command line. You will need to use a positional parameter to do this


How do you find and write the domain of a function?

how don you find write the domain of a function


What are write persmissions?

If a user has write permissions then that user is able to Delete or Modify that file. In the case of directories it means that user can create, delete, modify files in that folder.


What is the memory write operation?

read/write permissions/privileges allow the user to read, append and delete records from your database tables, however it cannot alter / create / drop the tables and its structures.Read/write privileges are ideal for forums and production websites that don't require creation or alteration of table structures on its normal operations.


Write an applet program to insert a text at a specified position?

bbbdb


Write a algorithm for doubly linked list in c?

sorry


How do you write the inverse function of -4?

Well, it would be hard to write an inverse function of -4, since -4 is not a function in the first place.


Can you delete information off of a floppy?

Yes, information can be deleted off of a floppy disk by simply deleting the files or formatting the disk. Once the data is removed, it is not immediately visible but may still be recoverable using specialized software.


What is CPU and write the function of its two main componentsie alu and cu?

write the function of cpu


How do you do you delete my contributions page in answers?

You cannot delete the 'My Contributions page'. You cannot delete the Contributors tab when you write an answer, either. Both of those remain permanent, and cannot and will not be deleted.