Past exam question: 2073 Bhadra (Regular), Q3(a)
Open in the Padhaiko appQuestion
Differentiate between a static and dynamic list structure.
Solution
Static List vs. Dynamic List:
| Aspect | Static List (Array) | Dynamic List (Linked List) |
|---|---|---|
| Size | Fixed at compile time (MAX); cannot grow past capacity | Dynamic; grows/shrinks at runtime via heap allocation |
| Memory Layout | Contiguous block; unused slots stay wasted | Scattered nodes connected via pointers |
| Access | random access via index | sequential traversal |
| Insert / Delete | element shifting | pointer rewiring once located |
Answer:
A static list uses fixed-size contiguous arrays with indexing and shifting, whereas a dynamic list uses runtime-allocated linked nodes with flexible sizing and pointer-based splicing.