RTUComputer ScienceYr 2023 · Sem 32023

Q5Data Structures

Question

2 marks

Differentiate between sequential and binary search.

Answer

Sequential search scans sequentially , while binary search optimally halves a strictly sorted dataset in time.

Sequential (Linear) Search blindly checks every single element one by one from the beginning, requiring an inefficient time complexity, but inherently works on completely unsorted data. Binary Search requires a strictly pre-sorted dataset, but achieves exceptional efficiency by repeatedly comparing the target to the middle element and immediately discarding half the remaining search space.

Back to Paper