• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

LinkedList from collection

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

LinkedList implementation uses a doulby-linked list. What does doubly linked list means? and how does it differ from array list?

TIA,

Saiprasad
 
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A normal linked list only allows navigation in one direction. That means from node n, you can only reach node n+1. A doubly-linked list allows navigation in either direction. From node n, you can reach both node n-1 and node n+1.

The real difference between a linked list and an array list has to do with how they are implemented "behind the scenes." You'll use the two almost as if they are the same but the way they are implemented is very different. An array list uses as a backbone an array. (Big surprise, huh?) A linked list, on the other hand, uses a number of "nodes" which reference the nodes before and after themselves in the list. Each implementation allows you to store multiple items in a list format and each one has some benefits and hindrances.

I suggest checking out this article from a past edition of the JavaRanch Journal.

As this seems to be a question about Java, in general, rather than specifically for the SCJP certification, I'm moving this thread to Java in General (Intermediate).
reply
    Bookmark Topic Watch Topic
  • New Topic