Week 6 Flashcards

1
Q

what does the bubble sorting algorithm do

A

walk through an entire array and compare each adjacent pair. if they are out of order, swap their positions. keep doing this until the entire array is sorted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what does the insertion sort do?

A

divide an array into sorted and unsorted, pick and remove a value from the unsorted side and insert it into the correct place in the sorted array, repeated this until the unsorted is empty and the sorted is full

How well did you know this?
1
Not at all
2
3
4
5
Perfectly