Shell Sort

preview_player
Показать описание
CS323: Data Structures and Algorithms, Emory University.
Рекомендации по теме
Комментарии
Автор

I thought this was the best explanation I've seen so far out of at least 5 videos. I notice some people saying he didn't explain why he chose k. I learned this on previous videos but found that you explained other parts of the sort more fully. For others wondering, k should be chosen initially by n/2, then divide k by 2 for each next traversal.

misskyleigh
Автор

You didn't explain why you chose only Hibbard's Sequence and not any other number and also its quite confusing

PrateekKhandelwal
Автор

Why k=3? What If you had 14 Items for example. You just skipped the most crucial part.

ViewOf
Автор

is it compulsory to take Hibbard Sequance or we can choose any number?

rushabhshah
Автор

Let's say 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Size n=11

You have to check 0, 0+5, 0+5+5
So 0, 5 and 10
After checking them, you get new gap,

So it is 0+2, 0+2+2, 0+2+2+2, 0+2+2+2+2
=0, 2, 4, 6, 8, 10
And also check 1, 3, 5, 7, 9 progressively.
After checking them you
Do once more
Gap2=floor(gap1/2)=1
=0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
And the completion is done after the checking of this.

shironoyami