| | |
Quick question on Shell sort complexity
Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
![]() |
•
•
Join Date: Apr 2008
Posts: 64
Reputation:
Solved Threads: 1
I am trying to figure out the time complexity for a best case scenario shell sort. I know worst case is O(n^2) and I think best case should be O(n^2) as well because even thought its already sorted it still has to break the array down into gaps and check those subsets until the gap=1 but I am somewhat wary of my answer. A Google search returned no confirmation. Can anyone confirm this for me?
Thanks in advance
Thanks in advance
•
•
Join Date: Mar 2009
Posts: 13
Reputation:
Solved Threads: 0
•
•
•
•
I am trying to figure out the time complexity for a best case scenario shell sort. I know worst case is O(n^2) and I think best case should be O(n^2) as well because even thought its already sorted it still has to break the array down into gaps and check those subsets until the gap=1 but I am somewhat wary of my answer. A Google search returned no confirmation. Can anyone confirm this for me?
Thanks in advance
best case complexity is O(n)
R Sedgewick has some freely available material here : Analysis of Shellsort and ...
Last edited by xkey; Mar 26th, 2009 at 12:57 am.
"There is only one corner of the universe you can be certain of improving, and that's your own self.”
-- Aldous Huxley
-- Aldous Huxley
![]() |
Other Threads in the Computer Science Forum
- Previous Thread: Really Don't Know What to Do!!!
- Next Thread: IT homework
| Thread Tools | Search this Thread |
Tag cloud for Computer Science
ai algorithm algorithms assignment assignmenthelp assignments battery bigbrother binary bittorrent bletchleypark blogging bomb business clueless codebreaker compiler computer computerscience computertrackingsoftware connect conversion csc data dataanalysis dataintepretation development dfa dissertation dissertationtopic ebook employment energy extensions floatingpoint foreclosure foreclosuresoftware fuel geeks givemetehcodez government graphics hardware history homeowners homework homeworkassignment homeworkhelp humor ibm idea ideas internet iphone ipod jobs kindle laser laws lazy linkbait lsmeans mainframes marketing mining mobileapplication nano netbeans networking news os p2p parser piracy piratebay programming rasterizer research sam-being-cute sas science security simulation software spoonfeeding spying sql stephenfry student supercomputer supercomputing sweden technology tree turingtest two'scompliment uk virus warehouse ww2





