Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

advantage Doublylink list over linklist

 
sam liya
Ranch Hand
Posts: 1240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what are the advantage of doublylink lists over normal link list?
 
Rob Spoor
Sheriff
Pie
Posts: 20552
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can traverse backwards. In a linked list, each node only has a link to the next node. In a doubly linked list, there is also a link to the previous node.

Note that java.util.LinkedList is in fact a doubly linked list.
 
sam liya
Ranch Hand
Posts: 1240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is ArrayList also dubli linked list?
 
Henry Wong
author
Marshal
Pie
Posts: 21212
81
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
aruna sameera wrote:is ArrayList also dubli linked list?


ArrayList is implemented with an Array -- not a linked list.

Henry
 
sam liya
Ranch Hand
Posts: 1240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think all ArrayList,LinkedList and vector implement the List interface in java?
is it true?
then how is ArrayList come from array?
 
Henry Wong
author
Marshal
Pie
Posts: 21212
81
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
aruna sameera wrote:i think all ArrayList,LinkedList and vector implement the List interface in java?
is it true?
then how is ArrayList come from array?


A linked list is a type of list. Not all lists are linked lists.

Henry
 
sam liya
Ranch Hand
Posts: 1240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you please tell me what are the other types of lists?
 
sam liya
Ranch Hand
Posts: 1240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but in my knowledge difference between ArrayList and LinkedList is linked lists is same as arraylist ,but we can traverse both side?is it true?
 
sam liya
Ranch Hand
Posts: 1240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and linked List also implemented queue interface?
 
Campbell Ritchie
Sheriff
Pie
Posts: 49447
64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The List documentation should tell you about known implementing classes, but that is only in the Sun API.
 
Rob Spoor
Sheriff
Pie
Posts: 20552
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All the List interface tells you is that you can access elements using an index, that the elements are ordered, and that you can traverse it both ways using the ListIterator returned by one of the two listIterator methods. Nothing more, nothing less. How it works internally differs per implementation.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic