Perhaps you've already heard about the ordered isomorphs from Planet Linear Chaos. You know, the ones who invented every sorting technique? Today we've received a task from them: the user enters 5 numbers from the keyboard, the method sorts the numbers in ascending order, and then another method displays them on the screen. Are you up to the challenge? If so, maybe you should visit Linear Chaos!
You must be signed in to leave a comment
11 October 2022, 07:00
can someone explain me the sort method of the example? i don't understand the "temp" variable or anything about the method. thanks.
5 May 2021, 18:52
using ArrayList; add the numbers to the ArrayList sort it using Collections.sort()method. then iterate and print out the numbers. rem to import java.util.*
6 May 2021, 11:50
6 May 2021, 11:52
I did not succeed for a long time because I did not specify the data type of the ArrayList - <Integer>
15 April 2021, 02:08
although we haven't hit ArrayList yet, it's so much nicer to use it. only using if/else just takes way too long.
4 January 2021, 11:58
i made the program, respect the requirements, still get error: "Should display 5 lines only". this is another example of "if you don't do it our way, is the wrong way". copied their code (without paying attention to it because it was 3 times bigger than mine) and moved on.
8 June 2020, 13:47
For those looking to complete without arrays heres a good explanation https://stackoverflow.com/a/26105101
20 July 2020, 16:33
Thanks. It's complicated but works amazingly. I had to use arrays because using just if/else if statements would be too inefficient, even for me. Now, I have to study why this actually works lol
28 September 2020, 16:03
It cycles through: all of the numbers * size() of array.
23 May 2020, 15:08
This code works fine. But is there any way that I can refine it?
31 January 2020, 16:31
what is wrong with my program.. Output matches the requirements
21 June 2019, 07:08
Is there a better way to do it without arrays?
8 September 2019, 21:36
16 September 2019, 19:03
Not a better way, but there are ways.