9. Summary: The Verdict
| Feature | Rating | Reason |
|---|---|---|
| Access | ⭐⭐⭐⭐⭐ | O(1). Instant Math. |
| Search | ⭐⭐⭐ | O(N) linear scan (unless sorted, then O(log N)). |
| Insert | ⭐ | O(N). Requires shifting everyone. |
| Delete | ⭐ | O(N). Requires shifting back. |
| Cache | ⭐⭐⭐⭐⭐ | CPU Loves it. Spatial Locality. |
| Memory | ⭐⭐⭐⭐ | Minimal overhead (no pointers), but fixed size waste. |
When to use:
- You need fast access by index.
- Amount of data is known or changes rarely.
- You are iterating over data heavily (Matrix ops, Image processing).
When NOT to use:
- You insert/delete items in the middle frequently (Use Linked List).
- You don't know how much data will come (Use Dynamic Array or Linked List).
"In the end, hardware loves Arrays. If you want speed, satisfy the hardware."