computer progra
specific elements
Searching Algorithms
Used for:
Used to find specific eleme
sequentially examines each
until target value is found o
if element is not found, retu
Linear search
Exam style explanation
Best case - O1
more efficient than linear se
divides the search interval u
found or list is exhausted
only works on sorted data
If data is not found then ret
O(log_n
Binary search Best ca
Complexity
Space c
the tim
than lin
Exam style explanation
specific elements
Searching Algorithms
Used for:
Used to find specific eleme
sequentially examines each
until target value is found o
if element is not found, retu
Linear search
Exam style explanation
Best case - O1
more efficient than linear se
divides the search interval u
found or list is exhausted
only works on sorted data
If data is not found then ret
O(log_n
Binary search Best ca
Complexity
Space c
the tim
than lin
Exam style explanation