PadhaikoAll subjects

Past exam question: 2072 Ashwin (Regular), Q4

Data Structure and Algorithms · 6 marks

Open in the Padhaiko app

Topic: Linked List

Question

Differentiate static and dynamic implementation of list with suitable example.

Solution

Static vs. Dynamic List Implementation:

FeatureStatic Implementation (Array)Dynamic Implementation (Linked List)
Allocation TimeCompile-time fixed array items[MAX]Runtime per-node malloc/free
CapacityFixed upper limit MAXFlexible; bounded only by heap RAM
Memory LayoutContiguous blockNon-contiguous scattered nodes via pointers
Access Speed direct index lookup sequential traversal
Insert / Delete element shifting pointer rewiring once located

Example: Suppose a list holds [10, 20, 30] and we insert 5 at index 0:

Answer:

Static lists use fixed contiguous arrays ( indexing, shifting), whereas dynamic lists use heap-allocated pointer-linked nodes (flexible capacity and head/middle splicing once located, with access).

All past exam questions for Data Structure and Algorithms