Linear Search Flashcards
All 2 cards in this deck
What are the main steps of a linear search?
e.g. search 4, 9, 2, 7 for the value 2- Compare the first value to the value searched for: .
- If they match, stop — the item is found.
- If not, move to the next value and repeat: , then → found.
Other than finding the value, what condition stops a linear search?
The end of the list is reached / every value has been checked (and the value was not found).