Past exam question: 2063 Baishakh (Regular / Back), Q2(a)
Open in the Padhaiko appQuestion
Write the merits and demerits of contiguous list and linked list.
Solution
Comparison of Merits and Demerits:
| Structure | Merits | Demerits |
|---|---|---|
| Contiguous List (Array) | random access by index; no pointer memory overhead; cache-friendly | Fixed capacity (MAX); wasted space if underused; shifting on insert/delete; needs contiguous RAM |
| Linked List | Dynamic sizing at runtime; insert/delete once position is known; uses scattered memory blocks | sequential access; extra memory per node for next pointer; poorer cache locality |
Answer:
Contiguous lists give indexing without pointer overhead but suffer fixed capacity and shifting; linked lists offer dynamic size and pointer splicing at the expense of traversal and pointer memory.