Follow this Pseudo code:

InsertBefore:
--Create The Node to be added.
--Set Next pointer of This Node to the Linked List Pointer.
--set Linked List pointer to Created Node

InsertAfter
--Create The Node to be added
--Use a Temporary Pointer to follow the Linked list down
NOTE: This Temporary point must not equal NULL, NIL, 0, 
------or any other symbol specifying NOTHING.
--Set the Temporary Pointer's Next pointer to Created Node

DeleteFirstNode
--Temporary Pointer = Linked List Pointer's Next pointer
--Dispose Linked List Pointer Data
--Linked List Pointer = Temporary Pointer

DeleteSpecifiedNode:
--Loop Pointer = Linked List Pointer's Next Pointer
--Previous Loop pointer = Linked List Pointer
--Loop
-----If Loop Pointer is to be deleted then
--------Previous Loop Pointer's next pointer = Loop Pointer's Next Pointer
--------dispose Loop Pointer
-----else
-------Previous Loop Pointer = Loop Pointer
-----end if
-----Loop Pointer = Previous Loop Pointer's Next Pointer
--End Loop when U reach the End of the Linked List
--if Linked List Pointer is to be Deleted then
-----Temporary Pointer = Linked List Pointer's Next pointer
-----Dispose Linked List Pointer Data
-----Linked List = Temporary Pointer
--end if

Please Understand that this MAY be seem
difficult to follow,  but I learned how 
to do this  with  a  Paper  and  pencil: 
This  should be  easy to  follow in that 
way.   Remember  that  each  Value(Node) 
points to another Value(Node).


      

Reply via email to