User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 427,380 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,034 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser: Programming Forums
Views: 1655 | Replies: 0
Reply
Join Date: Dec 2004
Posts: 5
Reputation: unikiller is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
unikiller unikiller is offline Offline
Newbie Poster

confused about shell sort ...

  #1  
Dec 15th, 2004
I am allitle confused about shell sorting , how exactly is it done ?

Say I have an array of 25 , 15 , 20 ,40,9,2,4,5,100,1

The next step would be gap1/2 , which would be 5 right ?

so then it would look like

2 15 20 40 9 25 4 5 100

after that what do I do ?
I am guessing you take 5 and divide by 2 again ?

Then , It'd be

2 15 9 40 4 25 20 5 100 1

then finally 2/2 which is one and it'd be


2,9,15,4,40,20,5,25,1,100 ?

I am confused , what did I do wrong ?





Also , what is the equation for the worst case ? I can't fidn these answers anywhere on the web, everyone website I visited has really confusing notations.

I think the worst case is Log N , isn't it ?



Please help me out , thanks in advanced :mrgreen:
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C Forum

All times are GMT -4. The time now is 4:05 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC