Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > need help in doubly linked list

Reply
Thread Tools

need help in doubly linked list

 
 
zoro
Guest
Posts: n/a
 
      11-20-2006
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

 
Reply With Quote
 
 
 
 
Jim Langston
Guest
Posts: n/a
 
      11-20-2006
"zoro" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) lkaboutprogramming.com...
> 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.


 
Reply With Quote
 
 
 
 
eriwik@student.chalmers.se
Guest
Posts: n/a
 
      11-20-2006
On 20 Nov, 13:24, "Jim Langston" <(E-Mail Removed)> wrote:
> "zoro" <(E-Mail Removed)> wrote in messagenews:2cb702fdd6052dc95258e13c8fe5cec9@local host.talkaboutprogramming.com...
>
> > 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 youTo 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.


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.

--
Erik Wikström

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Amazon Interview Question on Doubly Linked List, Plz help Mahesh C Programming 1 03-19-2008 08:56 AM
doubly linked list murali@pune Java 3 03-24-2006 09:30 AM
Warning when doubly linked list is defined gloablly chand Python 7 09-05-2005 07:28 PM
need for doubly linked list dssuresh6 C Programming 4 11-19-2004 03:22 AM
Does any one have heap sorting with doubly linked list in C? darth C Programming 0 04-30-2004 11:51 AM



Advertisments