Sorting Algorithms

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/41

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

42 Terms

1
New cards

Insertion Sort

builds a sorted left portion by inserting each element into its correct position

2
New cards

Insertion Sort Runtime Best

O(n)

3
New cards

Insertion Sort Runtime Average

O(n^2)

4
New cards

Insertion Sort Runtime Worst

O(n^2)

5
New cards

Insertion Sort Stable

yes

6
New cards

Insertion Sort In-Place

yes

7
New cards

Selection Sort

repeatedly finds the minimum and swaps it into place

8
New cards

Selection Sort Runtime Best

O(n^2)

9
New cards

Selection Sort Runtime Average

O(n^2)

10
New cards

Selection Sort Runtime Worst

O(n^2)

11
New cards

Selection Sort Stable

no

12
New cards

Selection Sort In-Place

yes

13
New cards

Merge Sort

divide array into halves recursively then merge sorted halves

14
New cards

Merge Sort Runtime Best

O(n log n)

15
New cards

Merge Sort Runtime Average

O(n log n)

16
New cards

Merge Sort Runtime Worst

O(n log n)

17
New cards

Merge Sort Stable

yes

18
New cards

Merge Sort In-Place

no

19
New cards

Heap Sort

builds a heap and repeatedly extracts min/max and rebuilds heap

20
New cards

Heap Sort Runtime Best

O(n log n)

21
New cards

Heap Sort Runtime Average

O(n log n)

22
New cards

Heap Sort Runtime Worst

O(n log n)

23
New cards

Heap Sort Stable

no

24
New cards

Heap Sort In-Place

yes

25
New cards

Quick Sort

choose a pivot and partition into < pivot and > pivot recursively

26
New cards

Quick Sort Runtime Best

O(n log n)

27
New cards

Quick Sort Runtime Average

O(n log n)

28
New cards

Quick Sort Runtime Worst

O(n^2)

29
New cards

Quick Sort Stable

no

30
New cards

Quick Sort In-Place

yes

31
New cards

Bucket Sort

distributes elements into buckets

32
New cards

Bucket Sort Runtime Best

O(n + k)

33
New cards

Bucket Sort Runtime Average

O(n + k)

34
New cards

Bucket Sort Runtime Worst

O(n^2)

35
New cards

Bucket Sort Stable

yes (if bucket sort uses stable sub-sort)

36
New cards

Bucket Sort In-Place

no

37
New cards

Radix Sort Runtime Best

O(d(n + k))

38
New cards

Radix Sort Runtime Average

O(d(n + k))

39
New cards

Radix Sort Runtime Worst

O(d(n + k))

40
New cards

Radix Sort Stable

yes

41
New cards

Radix Sort In-Place

no

42
New cards

Radix Sort

sorts digits from least to most significant using stable counting sort