| Author |
advantage Doublylink list over linklist
|
sameera liyanage
Ranch Hand
Joined: Nov 25, 2008
Posts: 643
|
|
|
what are the advantage of doublylink lists over normal link list?
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
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.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
sameera liyanage
Ranch Hand
Joined: Nov 25, 2008
Posts: 643
|
|
|
is ArrayList also dubli linked list?
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 16687
|
|
aruna sameera wrote:is ArrayList also dubli linked list?
ArrayList is implemented with an Array -- not a linked list.
Henry
|
 |
sameera liyanage
Ranch Hand
Joined: Nov 25, 2008
Posts: 643
|
|
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
Sheriff
Joined: Sep 28, 2004
Posts: 16687
|
|
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
|
 |
sameera liyanage
Ranch Hand
Joined: Nov 25, 2008
Posts: 643
|
|
|
can you please tell me what are the other types of lists?
|
 |
sameera liyanage
Ranch Hand
Joined: Nov 25, 2008
Posts: 643
|
|
|
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?
|
 |
sameera liyanage
Ranch Hand
Joined: Nov 25, 2008
Posts: 643
|
|
|
and linked List also implemented queue interface?
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32654
|
|
|
The List documentation should tell you about known implementing classes, but that is only in the Sun API.
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
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.
|
 |
 |
|
|
subject: advantage Doublylink list over linklist
|
|
|