there are a few sentences on how to insert a node into a
linkedList,delete a node from a linkedList:
1.insert a node at the beginning of a linkedList:
NewList.Next[NewNode]=Pointer
HEAD=NewNode
2.insert a node into the middle of a linkedList:
NewList.Next[NewNode]=NewList.Next[Pointer]
NewList.Next[Pointer]=NewNode
3. insert a node at the tail of linkedList:
NewList.Next[NewNode]=NewList.Next[Pointer]
NewList.Next[Pointer]=NewNode
delete a node from a linkedList:
1.delete a node from the beginning of a linkedList:
Header=NewList.Next[Pointer];
NewList.Next[Pointer]=-2;
2.delete a node from the middle of a linkedList:
NewList.Next[Back]=NewList.Next[pointer];
NewList.Next[Pointer]=-2;
3.delete a node from the tail of a linkedList;
NewList.Next[Back]=NewList.Next[pointer];
NewList.Next[Pointer]=-2;
i can't understand the text above. i just copy it from my book. can
someone give me some explanation about the above text. thanks in
advance.
Oliver Wong - 12 Jun 2006 16:48 GMT
> there are a few sentences on how to insert a node into a
> linkedList,delete a node from a linkedList:
[quoted text clipped - 21 lines]
> someone give me some explanation about the above text. thanks in
> advance.
I'm having trouble understanding the above text as well. I don't know
what the -2 literal is supposed to mean, for example.
If you want to understand what Link Lists are and how they work, you
might want to read this Wikipedia article:
http://en.wikipedia.org/wiki/Linked_list
- Oliver