Mapa mental
Search Algorithms
Conteúdo do mapa
Search Algorithms
Linear Search
- Check first value
- If desired value, stop search
- If not, move to next value and check
- Repeat until have checked all elements and not found desired value
- Line does not have to be in order
- Repeat until have checked all elements and not found desired value
- If not, move to next value and check
- If desired value, stop search
- Check first value
Binary Search
- List needs to be in order
- Take MIDDLE value
- Compare to the value you're looking for
- If reached desired value, stop search
- If larger than desired value, take values to the left of middle value
- If smaller than desired value, take values to the right of middle value
- Repeat with new list
- Only works if data is in order
- Repeat with new list
- If smaller than desired value, take values to the right of middle value
- If larger than desired value, take values to the left of middle value
- If reached desired value, stop search
- Compare to the value you're looking for
- Take MIDDLE value
- List needs to be in order
Informações
- Descrição
- Mapa Mental sobre Search Algorithms, criado por Avni Bhatt em 04-04-2019.
- Criado por
- Avni Bhatt
- Visualizações
- 0
- Avaliação