There are many sort algorithms in existance. The simplest but slowest is you have all your values in an array and you know the count of the array.
swap = true
while swap is true
swap = false
for index = 0 to cnt-1 step 1
if ary[index] > ary[index+1] then
tmp = ary[index]
ary[index+1] = ary[index]
swap = true
This one is very inefficient but will do the job. In essence the outer loop will loop forever until no swaps occur in the inner loop. This is know as a bubble sort as the numbers bubble along into their correct positions.
I strongly recommend you read up on sorting. Knuth has a great book on the subject containg pseudo code. His books are well worth having a prominent place in your bookcase.
Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"