answersLogoWhite

0

1. Find the element is the list. Let pointer 'p' point to it.

2. Delete it from the list:

if (p->Prev) p->Prev->Next = p->Next;

else List->First = p->Next;

if (p->Next) p->Next->Prev = p->Prev;

else List->Last = p->Prev;

3. Release the memory associated with it.

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Write a algorithm for doubly linked list in c?

sorry


How do you write a Java program to implement weighted queue using circular doubly linked list?

Add weights to the elements of the queue and use an algorithm to sort the queue every time an element is added.


Write an algorithm for the implementation of a circular doubly linked list?

Create a new node, making sure it is not allocated locally in the function and thus will not be destroyed when the function execution finishesFill in dataUse the "last node" pointer in the list and copy the "next" pointer location (pointing to the first node) into the new nodes "next" pointerSet the "last node" "next" pointer to point to the new nodeChange the list's "last node" pointer to point to the new nodeFor an example of implementation see: How_you_insert_a_newnode_in_singly_circular_link_list


Write an Algorithm to delete a last element from the array?

// Assuming you dynamically allocated this array using "new"... delete array[arraysize - 1]; arraysize--;


3 Write the algorithm of inserting an element at middle of a linked?

theory part to how u can insert element at middle of link list ?


Write an algorithm?

Algorithms are simply a set of steps to take in order to reach an answer. It is often linked with computer programming and can be written in plain english.


What is algorithm to write algorithm to the program to access a pointer variable in structure?

Here is the algorithm of the algorithm to write an algorithm to access a pointer in a variable. Algorithmically.name_of_the_structure dot name_of_the _field,eg:mystruct.pointerfield


Write an algorithm to find the root of quadratic equation?

Write an algorithm to find the root of quadratic equation


How to write an actual algorithm for inserting an element in a linked list?

Insert newNode into a linked list after targetNode Node currentNode = root while currentNode != targetNode currentNode = currentNode.next newNode.next = currentNode.next currentNode.next = newNode


A Write the algorithm to concatenate two given strings?

a write the algorithm to concatenate two given string


How do you write an Algorithm for a C plus plus Program?

You don't write an algorithm for a C++ program, unless you are documenting the C++ program after-the-fact. The normal procedure is to write the algorithm first, in a language independent fashion, and then translate that stated algorithm into C++ code, or into whatever language you wish.


Write an algorithm to check whether a number is a prime number or not?

You can write out this algorithm. This will then be programmed into the device to make determining prime numbers easier.