Shell Sort and Quick Sort Flashcards

1
Q

Define

Shellsort

A

Based on insertion sort.
1. Insertion sort woidely spaced items.
2. Insertion sort less widely spaced items, and so on
For example, do a sort on items four spaces apart, then 1 space apart.
O(N (logN)^2).

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

Define

Interval/gap sequence

A

The sequence of numbers used to generte the intervals between the numbers sorted in shellsort. Popular method is Knuth’s interval sequence, h = 3 x h +1. Important that these numbers are relatively prime, more likely to intermingle items sorted on previous pass

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