Mapa mental
SORTING ALGORITHMS
Conteúdo do mapa
SORTING ALGORITHMS
BUBBLE SORT
- Looks at first two items in list
- If they're in the wrong order, swap them
- Move to next pair of items and repeat
- Repeat until the end of the list. This is called one pass
- Repeat until they are completely in order
- Repeat until the end of the list. This is called one pass
- Move to next pair of items and repeat
- If they're in the wrong order, swap them
- Pros
- Simple algorithm
- Efficient way to check if a list is already in order
- Doesn't use a lot of memory
- Cons
- Inefficient
- Does not cope well with a large list of items
- Looks at first two items in list
MERGE SORT
- Split the list in half and carry on until there is only one item in each sub-list
- Merge them and order until you've merged all sub-lists together
- Pros
- More efficient than bubble
- Quicker than bubble
- Consistent running time
- Cons
- Slower for short lists
- Uses more memory
- Split the list in half and carry on until there is only one item in each sub-list
Informações
- Descrição
- Mapa Mental sobre SORTING ALGORITHMS, criado por Gurleen Bansal em 17-01-2019.
- Criado por
- Gurleen Bansal
- Visualizações
- 0
- Avaliação