In decreasing order

  • 5
  • Locked
The ordered isomorphs of Planet Linear Chaos love to sort and accept into their ranks those who are proficient at sorting. What's that you say? You don't plan on associating with them? That won't work: isomorphs are often the ones conducting interviews at IT companies. We won't ignore them: write a program that reads 20 numbers from the keyboard and displays them in decreasing order.
You can't complete this task, because you're not signed in.
Comments(9)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Mitesh ShahLevel 11 , London
24 January, 20:57
My code works, and it verifies correctly, but I am still confused. The sort method is void. It is not returning anything. So how is the sorted array being printed in the correct decreasing order?
Nickolas JohnsonLevel 8 , St. Louis
4 April, 14:02
Yeah, I don't get it either. I expected to have to print it out in the sort method.
Adrian Level 17 , Spanish Town
25 April, 08:24
the sort method is void, so it doesn't have a data type to return. when we call the function "sort(array)" we pass it a copy of the array and the code in that method changes the array's 'internal state' (sorts it in descending order).
Mitesh ShahLevel 11 , London
28 April, 13:16
Thanks, that clears it up for me.
LiewLevel 10
29 April, 00:42
remember when we use array its a reference point to an object, so whenever we touch that same object in different methods, what is in the array will change.
Kent HerveyLevel 13
25 November 2019, 05:06
It is still frustrating when I meet what I think are the requirements, but does not verify. I used collections sort then reversed. codegym did not like that. wants me to make my own sorting algorithm...so I did that and it passed. Okay because I learned two ways to do it.
buxiuleLevel 19 , Aptos
17 September 2019, 09:25
why ? i think i'm right. plz help me
MBCLevel 14 , Apeldoorn
14 July 2019, 15:35
Wait we can use the names sorting algorithms?
AndrewLevel 16 , Toronto
4 February 2019, 11:47
Hint: Bubble Sort