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

Java

 
AnswerRe: how to read a file in Binary mode? Pin
Richard MacCutchan27-Jan-10 2:12
mveRichard MacCutchan27-Jan-10 2:12 
QuestionConvert Java code to c++ Pin
002comp26-Jan-10 19:27
002comp26-Jan-10 19:27 
AnswerRe: Convert Java code to c++ Pin
427748026-Jan-10 20:04
427748026-Jan-10 20:04 
AnswerRe: Convert Java code to c++ Pin
Richard MacCutchan26-Jan-10 22:37
mveRichard MacCutchan26-Jan-10 22:37 
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 
bmnot wrote:
I thought i just gotta swap the index into temp and then change the small to that index and then the temp to the max so far?

Yes, that is right.

But what you're doing now is remember the index of the global max of the entire array, instead of just the part that you're supposed to be looking at. The next iteration you will need the max of a smaller part of the array, not the global max.

The Bad Things that happen at i == 0 are also partially a result of not resetting maxSoFar, it will not search for a new max (since 0 is not smaller than 0), and then swap them anyway. If you found the correct max (maxSoFar = 0 be cause it's the only one you can still scan) then swapping 0 with 0 has no effect, but you'd still have the old max, so strange things happen.
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 
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 

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.