Back to marketplace

2.3.3 Sorting Algorithms

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

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

Card preview (17)

#1
Front (Question)

How can a bubble sort be improved?

Back (Answer)

Adding a flag to record whether or not a swap has occured

#2
Front (Question)

Which sorting algorithm compares and swaps pairs of elements?

Back (Answer)

Bubble sort

#3
Front (Question)

What sorting algorithm places the largest element after the first pass?

Back (Answer)

Bubble sort

#4
Front (Question)

Name the 2 functions of a merge sort.

Back (Answer)

MergeSort( ) Merge( )

#5
Front (Question)

Which sorting algorithm uses pivots?

Back (Answer)

Quick sort

#6
Front (Question)

Which sorting algorithm is the fastest?

Back (Answer)

Quick sort

#7
Front (Question)

Outline the stages of a bubble sort.

Back (Answer)

Compare first value in list with the next If first is bigger, swap the positions Move to second value Repeat until no more items to compare Return to start of list Repeat until pass through made without any swaps needed

#8
Front (Question)

Outline the stages of a merge sort.

Back (Answer)

Repeatedly divide list in two until all elements separated into sublists Merge sublists to produce new sorted sublist Repeat until elements are in single list

#9
Front (Question)

Outline the stages of an insertion sort.

Back (Answer)

Separates first value as sorted list Compare next value in unsorted list with sorted Move value to correct position Repeat until the end of the list is reached

#10
Front (Question)

Outline the stages of a quick sort.

Back (Answer)

Pivot element selected All elements less than moved to left of pivot, all elements greater move to right Repeat process with new pivots for each side of list

#11
Front (Question)

What does the left pointer do in a quick sort?

Back (Answer)

Moves right until item larger than pivot found then it stops and hands to right pointer

#12
Front (Question)

What does the right pointer do in a quick sort?

Back (Answer)

Moves left until item smaller than pivot found then stops

#13
Front (Question)

What is the disadvantage of a quick sort?

Back (Answer)

If the split point is skewed too far left or right, division will be uneven Results in O(n²) time complexity

#14
Front (Question)

What is the time complexity for bubble sort?

Back (Answer)

O(n)

#15
Front (Question)

What is the time complexity for merge sort?

Back (Answer)

O(n log n)

#16
Front (Question)

What is the time complexity for quick sort?

Back (Answer)

O (n log n)

#17
Front (Question)

What is the time complexity for insertion sort?

Back (Answer)

O(n²)