how to single linked lists and doubly linked lists

Posted by Llarn on Sun 16 Nov 2008 08:23 AM — 2 posts, 12,242 views.

#0
I have a current thread posted on this here. If anyone
could elaborate on linked lists more I would greatly appreciate it.

http://www.smaugmuds.org/index.php?a=topic&t=3836&p=16196#p16196

Thanks
Australia Forum Administrator #1
The other thread seems to cover it quite well.

For a single linked list you just need the start (head), which would be NULL for an empty list. Then the start item points to the first one, and the first one points to the second one, and so on, until the last one points to NULL.

Doubly linked lists also have a backwards pointer, so you have a second pointer which is the end (tail), which points to the last item in the list. Then each item points to the previous one.