Can anyone help explain some weirdness with my code?? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Can anyone help explain some weirdness with my code??

This program asks the user for an integer, that corresponds to an array length. The program then generates the array and puts random numbers in it. It the sorts the array and times how long it takes. However it keeps saying that it took 0 ms to sort a random array that is over 200 in length. If anyone has an explanation as to why it does this please let me know. Here is a link to my code: https://code.sololearn.com/cVJMz10ByrqZ

20th Mar 2019, 1:18 PM
Sonny Grainger
Sonny Grainger - avatar
1 Resposta
0
I tried on https://repl.it/repls/GleefulIdolizedLibrary and your code works as expected. I think that the problem is in sololearn platform because "Exception in thread "main" java.util.NoSuchElementException" is raised
20th Mar 2019, 2:20 PM
Prokopios Poulimenos
Prokopios Poulimenos - avatar