Click here to Skip to main content
15,886,199 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Quicksort algorithm is Causing stack overflow Pin
JKallen9-Aug-06 16:58
JKallen9-Aug-06 16:58 
AnswerRe: Quicksort algorithm is Causing stack overflow Pin
Christian Graus9-Aug-06 16:54
protectorChristian Graus9-Aug-06 16:54 
GeneralRe: Quicksort algorithm is Causing stack overflow Pin
JKallen9-Aug-06 17:00
JKallen9-Aug-06 17:00 
GeneralRe: Quicksort algorithm is Causing stack overflow Pin
Christian Graus9-Aug-06 17:02
protectorChristian Graus9-Aug-06 17:02 
GeneralRe: Quicksort algorithm is Causing stack overflow Pin
JKallen9-Aug-06 17:04
JKallen9-Aug-06 17:04 
GeneralRe: Quicksort algorithm is Causing stack overflow Pin
Christian Graus9-Aug-06 17:40
protectorChristian Graus9-Aug-06 17:40 
AnswerRe: Quicksort algorithm is Causing stack overflow Pin
Gerald Schwab9-Aug-06 18:07
Gerald Schwab9-Aug-06 18:07 
AnswerRe: Quicksort algorithm is Causing stack overflow Pin
David Crow10-Aug-06 4:05
David Crow10-Aug-06 4:05 
I've not ever seen top/bottom used with quicksort. I use left/right. That aside...

The reason for the endless recursion is that top is always LT bottom. See if this helps:

void Sample::quicksort( int top, int bottom )
{
    if (top < bottom)
    {    
        int nMiddle = partition(top, bottom);
        quicksort(top, nMiddle<code> - 1</code>);
        quicksort(nMiddle + 1, bottom);
    }
}



"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank

"Judge not by the eye but by the heart." - Native American Proverb


AnswerRe: Quicksort algorithm is Causing stack overflow Pin
Hamid_RT10-Aug-06 8:15
Hamid_RT10-Aug-06 8:15 
QuestionEnum local security groups in NTFS folder ACL Pin
fourierman9-Aug-06 16:32
fourierman9-Aug-06 16:32 
AnswerRe: Enum local security groups in NTFS folder ACL Pin
Milton Karimbekallil9-Aug-06 23:45
Milton Karimbekallil9-Aug-06 23:45 
QuestionComparing images.... Visual C++ (MFC) Pin
cheng859-Aug-06 16:06
cheng859-Aug-06 16:06 
AnswerRe: Comparing images.... Visual C++ (MFC) Pin
Christian Graus9-Aug-06 16:55
protectorChristian Graus9-Aug-06 16:55 
AnswerRe: Comparing images.... Visual C++ (MFC) Pin
PJ Arends9-Aug-06 16:59
professionalPJ Arends9-Aug-06 16:59 
GeneralRe: Comparing images.... Visual C++ (MFC) Pin
kaushal kishore sharma5-Oct-08 22:24
kaushal kishore sharma5-Oct-08 22:24 
AnswerRe: Comparing images.... Visual C++ (MFC) Pin
Hamid_RT9-Aug-06 22:25
Hamid_RT9-Aug-06 22:25 
QuestionHELP!! Using "AtlEscapeUrl" Pin
atsuki9-Aug-06 15:55
atsuki9-Aug-06 15:55 
QuestionMaking a script language? Pin
Lord Kixdemp9-Aug-06 15:51
Lord Kixdemp9-Aug-06 15:51 
AnswerRe: Making a script language? Pin
Christian Graus9-Aug-06 17:00
protectorChristian Graus9-Aug-06 17:00 
GeneralRe: Making a script language? Pin
Lord Kixdemp9-Aug-06 17:29
Lord Kixdemp9-Aug-06 17:29 
AnswerRe: Making a script language? Pin
Rudolf Jan10-Aug-06 0:19
Rudolf Jan10-Aug-06 0:19 
Question[Help] MFC ypelib wrappers for MSXML5 Pin
oaks, rbt9-Aug-06 10:10
oaks, rbt9-Aug-06 10:10 
AnswerRe: [Help] MFC ypelib wrappers for MSXML5 Pin
Gerald Schwab9-Aug-06 18:20
Gerald Schwab9-Aug-06 18:20 
GeneralRe: [Help] MFC ypelib wrappers for MSXML5 [modified] Pin
oaks, rbt10-Aug-06 8:09
oaks, rbt10-Aug-06 8:09 
GeneralRe: [Help] MFC ypelib wrappers for MSXML5 Pin
Gerald Schwab10-Aug-06 9:21
Gerald Schwab10-Aug-06 9:21 

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.