need help in doubly linked list

Z

zoro

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
 
J

Jim Langston

zoro said:
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

To know when to stop, so you don't run off the end of the list. You have to
have someway to know when there is no node following.
 
E

eriwik

have someway to know when there is no node following.

That can be accomplished in other ways, like a null-pointer for
instance. What you can't do however is to begin a reverse traversal
without first making a normal traversal. It also allows quic insertion
of new elements at the end of the list since you don't have to traverse
the list to find the end each time.
 

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,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top