Sort Algorithms Flashcards

1
Q

A simple (and relatively) slow sorting algorithm that repeatedly loops through al its of values, comparing adjacent values and swapping them if they are in the wrong order.

Stable.
Avg Runtime O(N^2)

A

Bubble Sort

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

A type of sort that used a nested loop process to systematically find the best place in the current array for an unsourced item.

Uses a shift and insert technique
Stable
Avg RunTime O(N^2)

A

Insertion Sort

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

A recursive algorithm that continually splits a list in half, until each half is either empty or one item, at which point the two halves are merged together in natural order, back up to the division process until the entire list has been sorted.

Stable
Avg Runtime: O(N log N)

A

Merge Sort

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

Sometimes called partition-exchange sort, is an efficient sorting algorithm, serving as a systematic method for placing the elements of an array in order.

Not stable.
Avg Runtime: (N log N)

A

Quick Sort

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

A sorting routine that uses a nested loop process to systematically select the best value among the unsourced elements of the array for the next position in the array, starting with position zero all the way to the end.

Stable
Avg RunTime: O(N^2)
Uses a Swap Technique - swapping two values if one is better.

A

Selection Sort

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

An algorithm uses to arrange elements of an array into natural order, such as numeric or alphabetical.

A

Sort

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

The process in sort routines of exchanging two values in an array, using a temporary variable, taking three steps to execute.

A

Swap

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