List Interface - LinkedList

  • Pros and Cons of Using Array

  1. Pros : Array is simple structure and the access time is short.

  2. Cons : Immutable size. when Add, Remove Non-sequential data, it takes some time. But when Add, Remove sequential data from the end, it is fast. 1. Create bigger Array. 2. Copy data. 3. Change reference.

  • Background that LinkedList

LinkedList supplement the cons of Array(immutable size, time to Add&Remove)

  • LinkedList Type

  1. (Single)LinkedList : It has not good accessibility to each node.

  2. Doubly LinkedList : It improves accessibility than Single LinkedList.

  3. Doubly Circular LinkedList : Tail node connects head node and vice versa.

  • Performance Comparation between ArrayList and LinkedList

  • Data Structures : Array-based(Sequential) vs. Connection-based(Non-Sequential).

Collection

Read Data

Accessibility

Description

ArrayList

Fast

Good

Sequential Add, Remove are fast.

Inefficient memory use.

LinkedList

Slow

Bad

Much more data, worse accessibility.

Last updated