PadhaikoAll subjects

Past exam question: 2075 Baisakh (Back), Q8

Data Structure and Algorithms · 10 marks

Open in the Padhaiko app

Topic: Searching Algorithms

Question

Compare sequential search with binary search. Discuss about linear probing and quadratic probing.

Solution

Sequential Search vs. Binary Search:

AspectSequential (Linear) SearchBinary Search
PreconditionWorks on sorted or unsorted dataRequires sorted random-access array
MethodChecks elements one by one from index 0Halves search space at middle element each step
Best / Worst Time / /
Data StructureArrays and linked listsContiguous sorted arrays (not standard linked lists)

Linear Probing vs. Quadratic Probing (Open Addressing):

Answer:

All past exam questions for Data Structure and Algorithms