Linked List | Types of Linked Lists (Java)

One disadvantage of using arrays to store data is that arrays are static structures and therefore cannot be easily extended or reduced to fit the data set. Arrays are also expensive to maintain new insertions and deletions. A linked list is a linear data structure where each element is a separate object.




Each element (we will call it a node) of a list is comprising of two items - the data and a reference to the next node. The last node has a reference to null. The entry point into a linked list is called the head of the list. It should be noted that head is not a separate node, but the reference to the first node. If the list is empty then the head is a null reference.

A linked list is a dynamic data structure. The number of nodes in a list is not fixed and can grow and shrink on demand. Any application which has to deal with an unknown number of objects will need to use a linked list.

Advantages:
  • Linked lists are a dynamic data structure, allocating the needed memory while the program is running.
  • Insertion and deletion node operations are easily implemented in a linked list.
  • Linear data structures such as stacks and queues are easily executed with a linked list.
  • They can reduce access time and may expand in real time without memory overhead.


Disadvantages:
  • They have a tendency to use more memory due to pointers requiring extra storage space.
  • Nodes in a linked list must be read in order from the beginning as linked lists are inherently sequential access.
  • Nodes are stored incontiguously, greatly increasing the time required to access individual elements within the list.
  • Difficulties arise in linked lists when it comes to reverse traversing. For instance, singly linked lists are cumbersome to navigate backwards[1] and while doubly linked lists are somewhat easier to read, memory is wasted in allocating space for a back pointer.


Comments

  1. This comment has been removed by the author.

    ReplyDelete

  2. Nice blog..! I really loved reading through this article. Thanks for sharing such a amazing post with us and keep blogging...

    Informatica online training in Hyderabad
    Informatica training in Hyderabad
    Best Informatica online training in Hyderabad

    ReplyDelete
  3. Best Java training Institute in Ahmedabad, Java courses curated by Industry Expert, Java programming classes with Hands on Real-time Project & 100% Job assistance.
    https://corextrime.com/

    ReplyDelete
  4. Interesting! This is really a very useful content for those who are looking for java training in yamunanagar Thank You so much for sharing this with us.

    ReplyDelete
  5. thanks for sharing blog is very nice areicles sharing information tqq u

    ReplyDelete
  6. Thank u for posting such a valuable information.keep sharing like these.

    http://www.rstrainings.com/adv-java-online-training.html

    http://www.rstrainings.com/core-java-online-training.html

    ReplyDelete
  7. Hey, would you mind if I share your blog with my twitter group? There’s a lot of folks that I think would enjoy your content. Please let me know. Thank you.
    Java Training in Chennai | J2EE Training in Chennai | Advanced Java Training in Chennai | Core Java Training in Chennai | Java Training institute in Chennai

    ReplyDelete
  8. Thanks for sharing this great article. It made me understand few things about this concept which I never knew before. Keep posting such great articles so that I gain from it.
    Java Training in Chennai

    Java Training in Velachery

    Java Training in Tambaram

    Java Training in Porur

    Java Training in Omr

    Java Training in Annanagar

    ReplyDelete
  9. Thank you for your valuable post. It is really helpful. Keep posting.
    Visit us: Core Java Online Course
    Visit us: Best Online Java Course

    ReplyDelete

Post a Comment

Popular posts from this blog

Umbrella activities in Software Engineering

Operating System | Best Definition of Opetating System