4.3.4 Searching algorithms Flashcards

1
Q

What time complexity is:
linear search
binary search

A

O(n)

O(log n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the maximum number of items accessed when searching for a particular item from a list using a binary search?

A

2^(n) > length of the list

n is the max number of items

How well did you know this?
1
Not at all
2
3
4
5
Perfectly