Back to marketplace

Standard Sorting Algorithms

No description yet. This curated deck is ready for daily study.

Total cards: 6•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (6)

#1
Front (Question)

What happens in a bubble sort?

Back (Answer)

• We look at two pieces of data in turn. • We rearrange these two pieces of data (if needed) before moving onto the next two pieces of data. • Each time we go from the start of the data set to the end we call it a pass. • We cannot stop passing through the data set until we pass through it and move no pieces of data.

#2
Front (Question)

Example - rearrange the below data set so its in order from smallest to largest: 75, 10, 26, 97, 68

Back (Answer)

FIRST PASS: - Swap 75 and 10 (10, 75, 26, 97, 68) - Swap 75 and 26 (10, 26, 75, 97, 68) - Don’t swap 75 and 97 - Swap 97 and 68 (10, 26, 75, 68, 97) SECOND PASS: - Swap 75 and 68 (10, 26, 68, 75, 97) THIRD PASS (we moved data so needs to be done again) - - Change nothing. - Three passes

#3
Front (Question)

What happens in a merge sort?

Back (Answer)

• We break our data set up into pairs to start off with. • We re-arrange these pairs and then begin to merge these pairs together. • We repeat this process until we merge the whole data set back together and re-arrange that.

#4
Front (Question)

Example - Rearrange (75, 10, 26, 97, 68) using a merge sort.

Back (Answer)

• Break up the list into pairs (68 is ok on its own) • Swap 10 and 75 • Don’t swap 26 and 97 • Don’t swap 68 and nothing • Merge the two nearest pairs from the left together • 10, 26, 75, 97, 68 • Merge the big list and the 68 together • Rearrange • 10, 26, 68, 75, 97

#5
Front (Question)

What happens in an insertion sort?

Back (Answer)

• We create a temporary list. • We work our way through our data set and place each piece of data into the correct location in the temporary list.

#6
Front (Question)

Use an insertion sort to sort: 75, 10, 26, 97, 68

Back (Answer)

• 75 is the first term in the temporary list • 10 is smaller than 75, so it goes to first place in a new list (75 goes to 2) • 26 slots between 10 and 75 • 97 goes at the end • 68 goes in the middle. SHOW EACH INSERTION!