i need help indoubly linked list please

Joined
Nov 7, 2006
Messages
4
Reaction score
0
hello:
i'm not sure what the operations that would be affected if we didn't maintain a tail pointer in doubly linked list?

so why is it important?

your help is appreciated
thank you
 
Joined
Nov 6, 2006
Messages
5
Reaction score
0
this is the concept of a linked list:


Code:
NULL<----
        |     
        Node 1<----
          |        |
           ---->Node 2<----
                |          |
                 ---->Node 3
                           |
                            ---->NULL



All Nodes contain two Node pointers:
- nextPtr
- previousPtr

To identify the tail of the list the last nodes nextPtr is set to NULL, as with the first node the previousPtr is set to NULL. You can create a circular list by setting the first nodes previousPtr to the last node and the last nodes nextPtr to the first node.
 
Joined
Nov 16, 2006
Messages
5
Reaction score
0
A tail pointer:
- will help you add nodes faster
- might help when you want to use a FIFO system
- might help when you want to sort
- might help tell the end when you traverse your list to the end
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top