Unit 9: Searching and Sorting Algorithms Flashcards

1
Q

A sorting algorithm that treats the input as two parts, sorted and unsorted, and repeatedly selects the proper next value to move from the unsorted part to the end of the sorted part.

A

Sortion Algorithm.

[3, 4, 2, 5, 1] –> [1, 2, 3, 4, 5]

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

A sorting algorithm that treats the input as two parts, sorted and unsorted, and repeatedly inserts the next value from the unsorted part into the correct location in the sorted part.

A

Insertion Sort Algorithm

Keeps checking previous indices until current value is not less than previous value or until current index equals 0 if less than all previous values.

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

A sorting algorithm that repeatedly partitions the input into low and high parts (each unsorted), and then recursively sorts each of those parts. To partition the input, _____ chooses a pivot to divide the data into low and high parts

A

Quick sort algorithm

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

The ___ can be any value within the sorted array, commonly the value of the middle array element.

A

Pivot

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

All values in the ________ are less than or equal to the pivot value.

A

Low partition

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