Searching algorithms Flashcards

1
Q

How does a linear search work

A

Used to find an item in a list.
It checks the first item, if it is not a match it moves onto the next until it is a match

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

How does a binary search work

A

Needs an ordered list.
It continuously divides the list in half until the item is found.

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