![]() |
|
#1
|
|||
|
|||
Help to translate an algorithm to a linked list formatHelp
Here is the algorithm: 1.) Set the next part of the node referred to by predptr equal to the next part of the node pointed to by ptr. 2.) Return the node pointed to by ptr to the storage pool. The textbook I have don't have that much example that I can follow. Please help.. Thank you. |
|
#2
|
||||
|
||||
Re: Help to translate an algorithm to a linked list formatDefinition:
predptr points to the previous node in the linked list ptr points to the current node nextptr (added for this discription) points to the next node in the linked list In each, the next value points to the next node in the list -- from that node's standpoint. IOW -- the next value in predptr points ptr -- the next value in ptr points nextptr Algorithm: 1) Take the current pointer's next value and copy it into the previous pointer's next value. This effectively makes the previous node's next value point to nextptr. This unlinks ptr from the linked list. 2) Delete ptr. __________________
Age is unimportant -- except in cheese |
Recent GIDBlog
Toyota - 2008 August Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Airport Log program using 3D linked List : problem reading from file | batrsau | C Programming Language | 11 | 29-Feb-2008 07:44 |
| [Include] Doubly-linked List | dsmith | C Programming Language | 6 | 14-Apr-2006 13:12 |
| linked list error message | Krandygrl00 | C++ Forum | 4 | 22-Jun-2005 14:13 |
| search linked list | itsmecathys | C++ Forum | 20 | 18-Apr-2005 01:34 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The