List Interface - LinkedList
Pros and Cons of Using Array
Pros : Array is simple structure and the access time is short.
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
(Single)LinkedList : It has not good accessibility to each node.
Doubly LinkedList : It improves accessibility than Single LinkedList.
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