-
A Static Array have a fixed size and cannot grow or shrink in size.
-
A Dynamic Array is a data structure that can grow and shrink in size.
- When the array is full, it doubles its size.
-
Advantages
- Dynamic - can grow and shrink in siz
- Efficient - insertion and deletion are O(1)
- Random Access - possible
-
Disadvantages
- Extra Memory - each node requires extra memory to store the pointer
- Wasted Memory - when the array is full, it doubles its size, but only uses half of the new space
- Slow - when the array is full, it doubles its size, which is an expensive operation
This repository was archived by the owner on Mar 22, 2024. It is now read-only.