i am writing a program with array. the program will generate ten random numbers
i am trying put those number into empty array. the list has to be in numerically ascending as numbers are entered
e.g 12 87 8 15 16 1 77 99 10 40.
the output should be
Each time the number is entered the list grow as represented.Quote:
12 12 8 8 8 1 1 1 1 1
87 12 12 12 8 8 8 8 8
87 15 15 12 12 12 10 10
87 16 15 15 15 12 12
87 16 16 16 15 15
87 77 77 16 16
87 87 77 40
99 87 77
99 87
99
i tried to use selection sort but i can't get the required output. I got this output.
init:
deps-jar:
compile-single:
run-single:
78
78 30
78 30 12
78 30 12 81
78 30 12 81 43
78 30 12 81 43 42
78 30 12 81 43 42 56
78 30 12 81 43 42 56 45
78 30 12 81 43 42 56 45 83
78 30 12 81 43 42 56 45 83 41
BUILD SUCCESSFUL (total time: 0 seconds)
but i don't know how to sort as necessary. Need help.

