• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Implementing Sample sort algorithm  RSS feed

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to implement the samplesort algorithm and would need help since I couldn't find some java code in the internet so I work with the Pseudo Code from Wikepedia. So far I have this Code:

which isn't verry much. My biggest Problem is, that I don't now much about this algorithm and I also don't find much on the internet.
So referring to the Pseudo Code on Wikepedia, I sorted the Samples. In the last step I inplemented my pivot elements with the elements from Sample.
Now I'm stuck. I don't understand how the rest of the pseudo code works because I don't know how to find j.
So somebody could make me very happy if he can help me to finish this algorithm.
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are many sorting algorithms. According to what you posted, it looks like you are trying to implement the quicksort algorithm. In my opinion the simplest sorting algorithm to understand is the bubble sort. In any case and contrary to what you claim, I did find Web pages that explain how to implement quicksort in java. Here is a page explaining quicksort in java. Simply google for quicksort java. And here is a page explaining bubble sort. Again simply google for java bubble sort. By the way, in case you are unaware, class java.util.Arrays has several, static sort() methods.
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Quick Sort Algorithm


 
Hans Peterson
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I'm not trying to implement the quicksort algorithm. I'm trying to implement this algorithm wich hasn't a verry detailed pseudo code.
 
Morning came much too soon and it brought along a friend named Margarita Hangover, and a tiny ad.
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!