Mapa mental
Searching and sorting
Conteúdo do mapa
Searching and sorting
Buble sort
- The algorithm starts at the beginning of the data set. It compares the first two value, and if the first is greater than the second, it swaps them. It continues doing this for each pair of adjacent values to the end of the data set. It then starts again with the first two elements, repeating until no swaps have occurred on the last pass. This algorithm is particularly useful when you need to find the top x values of a list.
Insertion sort
- To start with, the algorithm considers the first value of a list as a sorted sub-list (of one value to start with). This iterative algorithm then checks each value in the remaining list of values one by one. It inserts the value into the sorted sub-list of the data set in the correct position, moving higher ranked elements up as necessary. This algorithm is not always very efficient and is mostly recommended when sorting a small lists of values or a list that is already almost sorted.
Merge sort
- Split the list in half until until it becomes 2 items. they rearrange those 2 items in order and you combine all the items to put them in order
Binary search
- Binary search . Lay out all the data in order . See if the item is on a half on each side . If it is on one side get rid of the other side . Split the half in half and see what side it's on . Split in half again and repeat till item is found
Linerar search
- Linear search goes through all the items in the list one by one until it finds what you are looking for
Informações
- Descrição
- Mapa Mental sobre Searching and sorting, criado por Johan Iwanczyk em 24-10-2024.
- Criado por
- Johan Iwanczyk
- Visualizações
- 1
- Avaliação