Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Radix Sort in descending order help

 
Langer Flanger
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having difficulty converting this radix sort algorithm into descending order. Can anyone help me revise this code please?


[ added code tags for readability - Jim ]
[ April 09, 2007: Message edited by: Jim Yingst ]
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Why not start the value of index at the arr.length -1 and do index--

Bill
 
Langer Flanger
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it almost worked, but it only sorts some numbers in descending order, leaving the rest all jumbled up
 
Langer Flanger
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
btw, anybody can still answer my question. I still don't have the answer. Thank you in advance.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic