Search and sorts Flashcards
1
Q
linear search
A
searches each value from start to finish until item located
2
Q
binary search
A
better, only works on sorted lists
divides list into 2, compares and discards the side its not it, repeat
3
Q
bubble sort
A
compares n and n+1, swaps if nessecary, repeats until no swaps are made in a pass
4
Q
insertion sort
A
creates list of size 1, then ads unsorted list to the correct position in the new list
5
Q
Merge sort
A
seperate to individual elements, pair up in sorted order, repeat (faster, difficult to code)