Shell Sort problem

Posted by user191603 on Stack Overflow See other posts from Stack Overflow or by user191603
Published on 2009-11-26T03:03:45Z Indexed on 2010/05/03 18:08 UTC
Read the original article Hit count: 151

Filed under:
|

Show the result of running Shell Sort on the input 9,8,7,6,5,4,3,2,1 using increments { 1,3,7 }.

I have done this part. the result is:

9 8 7 6 5 4 3 2 1 (original)
2 1 7 6 5 4 3 9 8 ( 7-sort )
2 1 4 3 5 7 6 9 8 ( 3-sort )
1 2 3 4 5 6 7 8 9 ( 1-sort )

Then the question requires me to determine the running time of Shell Sort using Shell's increments of N/2, N/4, ..., 1 for sorted input.

I am not quite sure how to answer the second question as I don't understand the requirement of this question. So, would anyone give some hints to let me finish this question? Thank you for your help first!

© Stack Overflow or respective owner

Related posts about sorting

Related posts about homework