Search Algorithms Flashcards
1
Q
Types of Search Algorithms
A
Binary Search
Linear Search
2
Q
Binary Search
A
- Find middle term in ordered list
- If this is the item you are looking for, stop search
- If not, compare item being looked for to the middle term
- If it is before the middle term, get rid of second half of the list
- If it is after the middle term, get rid of first half of list
- Repeat with smaller list until item is found
3
Q
Linear Search
A
Checks each term in a sequence sequentially until the item being looked for is found
4
Q
Disadvantages of Linear Search
A
Not efficient, so only can be used on small lists