Sizing | Advantage | Disadvantage | |
ArrayList | Dynamic | – The linear structure is helpful when ordering elements. – It can be used to store sorted elements from other ADTs. – It can grow indefinitely. -Efficient use of memory for each element | – Slow search as every element must be looked at. |
LinkedList | Dynamic | – Same as ArrayList | – Uses more memory because each node object must be created and stored. -Slow search |
Array | Static | – The linear structure is helpful when ordering elements. – Most efficient memory usage of all data structures, when used appropriately. | – It can waste a lot of reserved memory space if initialized with a big size and most of it is not used. – Slow search – Fixed size |
Binary Search Tree | Dynamic | – Fast search – Fast deletion – Fast insertion – Can grow indefinitely – There are many variations that help improve search speeds. | – Uses more memory because each node object must be created and stored. |
Insertion | Access | Search | Memory | |
ArrayList | O(1) – excellent | O(1) – excellent | O(n) – bad | Low usage |
LinkedList | O(1) – excellent | O(1) – excellent | O(n) – bad | High Usage |
Array | O(1) – excellent | O(1) – excellent | O(n) – bad | Depends on the programmer |
Binary Search Tree | O(log n) – good | O(log n) – good | O(log n) – good | High Usage |