Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

shell sort  RSS feed

 
abalfazl hossein
Ranch Hand
Posts: 635
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is not homewrok, I want to learn about shell sort, I searcha nd study and find these codes, But I do not get the idea, I don't know how do they work. May you explain about shell sort and give a simple example for that?a code that can be more understadable





 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The book Algorithms and Data Structures has a section on sorting algorithms, including Shell Sort.

This visualization of sorting algorithms is instructive, and includes Java source code that is more readable and better documented than what you posted.
 
Campbell Ritchie
Marshal
Posts: 55680
161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote: . . . more readable and better documented than what you posted.
Your unindented code is particularly difficult to read. People will be reluctant to help if you don't take the effort to post code they can read.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!