PadhaikoAll subjects

Past exam question: 2063 Baishakh (Regular / Back), Q2(a)

Data Structure and Algorithms · 4 marks

Open in the Padhaiko app

Topic: Linked List

Question

Write the merits and demerits of contiguous list and linked list.

Solution

Comparison of Merits and Demerits:

StructureMeritsDemerits
Contiguous List (Array) random access by index; no pointer memory overhead; cache-friendlyFixed capacity (MAX); wasted space if underused; shifting on insert/delete; needs contiguous RAM
Linked ListDynamic 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.

All past exam questions for Data Structure and Algorithms