Click here to Skip to main content
14,267,350 members
   

Java

 
AnswerRe: Connecting to website and checking elements Pin
jschell15-Dec-18 7:07
memberjschell15-Dec-18 7:07 
GeneralRe: Connecting to website and checking elements Pin
Valentinor15-Dec-18 9:30
memberValentinor15-Dec-18 9:30 
QuestionHandle Multiple Threads With One Server Pin
Member 1408670212-Dec-18 0:45
memberMember 1408670212-Dec-18 0:45 
AnswerRe: Handle Multiple Threads With One Server Pin
Richard MacCutchan12-Dec-18 21:54
protectorRichard MacCutchan12-Dec-18 21:54 
AnswerRe: Handle Multiple Threads With One Server Pin
jschell15-Dec-18 7:12
memberjschell15-Dec-18 7:12 
QuestionMerge sort question Pin
Member 1408406810-Dec-18 5:31
memberMember 1408406810-Dec-18 5:31 
AnswerRe: Merge sort question Pin
Richard MacCutchan10-Dec-18 6:32
protectorRichard MacCutchan10-Dec-18 6:32 
GeneralRe: Merge sort question Pin
Member 1408406810-Dec-18 11:37
memberMember 1408406810-Dec-18 11:37 
Thanks,

of course, I was sure it was simple.

Just last question maybe easier :

In this part of the code :

// Main function that sorts arr[l..r] using
// merge()
void sort(int arr[], int l, int r)
{
    if (l < r)
    {
        // Find the middle point
        int m = (l+r)/2;

        // Sort first and second halves
        sort(arr, l, m);
        sort(arr , m+1, r);

        // Merge the sorted halves
        merge(arr, l, m, r);


I wonder if the result of (l+r)/2 is not an integer number (by example: 10,5), then is not it possible the machine become stuck?

I know I am wrong but what I ask is how what I said is made impossible inner the code?

in another way what the code have invented to prevent this?

Thanks very much,

Intelego
GeneralRe: Merge sort question Pin
Richard MacCutchan10-Dec-18 21:50
protectorRichard MacCutchan10-Dec-18 21:50 
GeneralRe: Merge sort question Pin
Member 1408406811-Dec-18 0:30
memberMember 1408406811-Dec-18 0:30 
QuestionBuffer reading is hanging while reading ? Pin
GiteHrudaya10-Dec-18 1:28
memberGiteHrudaya10-Dec-18 1:28 
AnswerRe: Buffer reading is hanging while reading ? Pin
Richard MacCutchan10-Dec-18 4:41
protectorRichard MacCutchan10-Dec-18 4:41 
AnswerRe: Buffer reading is hanging while reading ? Pin
jschell15-Dec-18 7:17
memberjschell15-Dec-18 7:17 
QuestionJava Gui Project Pin
Member 140826818-Dec-18 22:26
memberMember 140826818-Dec-18 22:26 
AnswerRe: Java Gui Project Pin
Peter_in_27808-Dec-18 23:09
professionalPeter_in_27808-Dec-18 23:09 
AnswerRe: Java Gui Project Pin
Richard MacCutchan9-Dec-18 2:00
protectorRichard MacCutchan9-Dec-18 2:00 
QuestionDatabase Connection from Java Pin
prithaa8-Dec-18 6:07
memberprithaa8-Dec-18 6:07 
GeneralRe: Database Connection from Java Pin
Richard MacCutchan8-Dec-18 6:54
protectorRichard MacCutchan8-Dec-18 6:54 
Questionhelp turning code into gui Pin
Member 140790227-Dec-18 11:55
memberMember 140790227-Dec-18 11:55 
AnswerRe: help turning code into gui Pin
Richard MacCutchan7-Dec-18 22:21
protectorRichard MacCutchan7-Dec-18 22:21 
QuestionObjectInputStream block on server side Pin
Valentinor4-Dec-18 4:42
memberValentinor4-Dec-18 4:42 
Questionresearch methodology Pin
Member 140745404-Dec-18 1:45
memberMember 140745404-Dec-18 1:45 
AnswerRe: research methodology Pin
Richard MacCutchan4-Dec-18 2:40
protectorRichard MacCutchan4-Dec-18 2:40 
Questionjava Pin
GiteHrudaya3-Dec-18 18:38
memberGiteHrudaya3-Dec-18 18:38 
QuestionRe: java Pin
Richard MacCutchan3-Dec-18 22:01
protectorRichard MacCutchan3-Dec-18 22:01 

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.