Click here to Skip to main content
15,888,610 members
Home / Discussions / Java
   

Java

 
QuestionJava Array Sorting Problem Pin
bmnot26-Jan-10 8:40
bmnot26-Jan-10 8:40 
AnswerRe: Java Array Sorting Problem Pin
harold aptroot26-Jan-10 8:50
harold aptroot26-Jan-10 8:50 
GeneralRe: Java Array Sorting Problem Pin
bmnot26-Jan-10 11:17
bmnot26-Jan-10 11:17 
GeneralRe: Java Array Sorting Problem Pin
harold aptroot26-Jan-10 11:27
harold aptroot26-Jan-10 11:27 
GeneralRe: Java Array Sorting Problem Pin
bmnot26-Jan-10 11:39
bmnot26-Jan-10 11:39 
GeneralRe: Java Array Sorting Problem Pin
harold aptroot26-Jan-10 11:45
harold aptroot26-Jan-10 11:45 
GeneralRe: Java Array Sorting Problem Pin
bmnot26-Jan-10 12:02
bmnot26-Jan-10 12:02 
GeneralRe: Java Array Sorting Problem Pin
harold aptroot26-Jan-10 12:26
harold aptroot26-Jan-10 12:26 
Now you're resetting maxSoFar too often Smile | :)
Oh this is not messy.. just wait until you have to implement things like chordal graph colouring...

About the first element - yes, it would stop before it. But you wouldn't move it even if you did not stop before it. The only candidate for swapping would be itself, and that's not very useful. Also you could see it like this, all following items are already correctly sorted (because of the selection-sort invariant which says that the "last" portion of the array is already perfect), and you only have 1 item left, it must already be in the right place, since it can not go anywhere else. It's not a problem if list[0] was not the smallest element in the beginning - it will be the smallest now (so apparently it got swapped already)
GeneralRe: Java Array Sorting Problem Pin
bmnot26-Jan-10 13:40
bmnot26-Jan-10 13:40 
GeneralRe: Java Array Sorting Problem Pin
harold aptroot27-Jan-10 1:10
harold aptroot27-Jan-10 1:10 
GeneralRe: Java Array Sorting Problem Pin
harold aptroot1-Feb-10 1:06
harold aptroot1-Feb-10 1:06 
GeneralRe: Java Array Sorting Problem Pin
Luc Pattyn26-Jan-10 15:24
sitebuilderLuc Pattyn26-Jan-10 15:24 
QuestionCan a Java application call a DotNet WCF service? Pin Pin
ashishtango24-Jan-10 17:33
ashishtango24-Jan-10 17:33 
AnswerRe: Can a Java application call a DotNet WCF service? Pin Pin
427748024-Jan-10 18:14
427748024-Jan-10 18:14 
AnswerRe: Can a Java application call a DotNet WCF service? Pin Pin
Richard MacCutchan24-Jan-10 22:23
mveRichard MacCutchan24-Jan-10 22:23 
QuestionAudio Files in socket programming. [modified] Pin
vidzdas24-Jan-10 2:08
vidzdas24-Jan-10 2:08 
AnswerRe: Audio Files in socket programming. Pin
Richard MacCutchan24-Jan-10 2:30
mveRichard MacCutchan24-Jan-10 2:30 
GeneralRe: Audio Files in socket programming. Pin
vidzdas24-Jan-10 6:19
vidzdas24-Jan-10 6:19 
GeneralRe: Audio Files in socket programming. Pin
Richard MacCutchan24-Jan-10 9:19
mveRichard MacCutchan24-Jan-10 9:19 
GeneralRe: Audio Files in socket programming. Pin
427748024-Jan-10 18:15
427748024-Jan-10 18:15 
GeneralRe: Audio Files in socket programming. Pin
Richard MacCutchan24-Jan-10 22:07
mveRichard MacCutchan24-Jan-10 22:07 
GeneralRe: Audio Files in socket programming. Pin
427748024-Jan-10 22:20
427748024-Jan-10 22:20 
GeneralRe: Audio Files in socket programming. Pin
Richard MacCutchan24-Jan-10 23:10
mveRichard MacCutchan24-Jan-10 23:10 
GeneralRe: Audio Files in socket programming. Pin
427748024-Jan-10 23:27
427748024-Jan-10 23:27 
AnswerRe: Audio Files in socket programming. Pin
san-shiro{701}10-Feb-10 11:43
san-shiro{701}10-Feb-10 11:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.