25: Algorithms Flashcards
1
Q
What does a bubble sort do?
A
- orders an unordered list of items by comparing each item with the next one and swapping the items if they are out of order
- The algorithm is finished when no more swaps can be made
- very inefficient but easy to implement, good for small data sets
2
Q
What does an insertion sort do?
A
- inserts each item into its correct position in a data set one at a time - it is a useful algorithm for small data sets