Timeline for Given three numbers, find the second greatest of them
Current License: CC BY-SA 3.0
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 26, 2016 at 5:26 | comment | added | wchargin |
@mdfst13: I agree completely. Furthermore, in my opinion, the code is "more" incorrect not because of the increment but because it is not simply Arrays.sort(xs).
|
|
| Jun 25, 2016 at 13:52 | comment | added | Jules |
@mdfst13 Indeed. If you wanted a different language, a functional one would be better (secondHighest = head . tail . sort), but that's clearly not what the OP is after. He's also after high performance solution, which this quite clearly isn't.
|
|
| Jun 25, 2016 at 12:08 | comment | added | mdfst13 |
As a general rule, please stick to the language in the question. Also, we are more focused on review than code. The base insight here has already been posted. And worst, your solution is wrong. You say A[j++] three times when you should be saying A[j+1].
|
|
| Jun 25, 2016 at 11:42 | review | First posts | |||
| Jun 25, 2016 at 12:08 | |||||
| Jun 25, 2016 at 11:39 | history | answered | JEET | CC BY-SA 3.0 |