Dynamic Arrays
A dynamic array grows by allocating a larger block and copying when the current block is full. Append is cheap on average because copies are rare.
Costs
| Category | Data Structure |
| Difficulty | Easy |
| Read by index | O(1) |
| Append | O(1) amortized |
| Insert in the middle | O(n) |
Questions
What is Dynamic Arrays?
A dynamic array grows by allocating a larger block and copying when the current block is full. Append is cheap on average because copies are rare.
Where do I practice it?
DSA Master keeps challenges and progress on the phone. This page is the idea and the costs.