25: Algorithms Flashcards

You may prefer our related Brainscape-certified 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly