• Post Reply Bookmark Topic Watch Topic
  • New Topic

What's wrong with my Shell Sort algorithm?  RSS feed

 
Sina Meraji
Greenhorn
Posts: 13
Java Mac OS X Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Based on my understanding of shell sort, this must be working, but it isn't. (I started writing this code before googling shell sort pseudo codes, and just wrote it based on the logic i perceive.)

Been debugging it for a few hours now. Can't tell what's going wrong.

 
praveen kumaar
Ranch Hand
Posts: 461
22
Android Chrome Eclipse IDE Google App Engine Java Notepad Oracle Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is a showArray(...),where it is?.please post your code in full or either put a link for your full code so that we can help you better.
did you have performed the insertion sort after the gap sorting.please show your full code.

Praveen
 
Junilu Lacar
Sheriff
Posts: 11494
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just saying "it doesn't work" is useless. What are you seeing? Any errors? Does it end with the array still not sorted? Are you displaying the results after you exit the outermost loop? Please TellTheDetails
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!