This java code sorts a temporary array in ascending order, make it sort in descending order plz n ty?
First off, the if statement needs to be Less Than 0 and not Greater Than. That should do it. You may also need to change the element + 1's to element - 1's in the swap method, but I'm not sure about that.
No comments:
Post a Comment