Click here to Skip to main content
14,845,771 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Quicksort algorithm is Causing stack overflow Pin
JKallen9-Aug-06 16:58
MemberJKallen9-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
MemberJKallen9-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
MemberJKallen9-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
MemberGerald Schwab9-Aug-06 18:07 
AnswerRe: Quicksort algorithm is Causing stack overflow Pin
David Crow10-Aug-06 4:05
MemberDavid 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
MemberHamid_RT10-Aug-06 8:15 
QuestionEnum local security groups in NTFS folder ACL Pin
fourierman9-Aug-06 16:32
Memberfourierman9-Aug-06 16:32 
AnswerRe: Enum local security groups in NTFS folder ACL Pin
Milton Karimbekallil9-Aug-06 23:45
MemberMilton Karimbekallil9-Aug-06 23:45 
QuestionComparing images.... Visual C++ (MFC) Pin
cheng859-Aug-06 16:06
Membercheng859-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
Memberkaushal kishore sharma5-Oct-08 22:24 
AnswerRe: Comparing images.... Visual C++ (MFC) Pin
Hamid_RT9-Aug-06 22:25
MemberHamid_RT9-Aug-06 22:25 
QuestionHELP!! Using "AtlEscapeUrl" Pin
atsuki9-Aug-06 15:55
Memberatsuki9-Aug-06 15:55 
QuestionMaking a script language? Pin
Lord Kixdemp9-Aug-06 15:51
MemberLord 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
MemberLord Kixdemp9-Aug-06 17:29 
AnswerRe: Making a script language? Pin
Rudolf Jan10-Aug-06 0:19
MemberRudolf Jan10-Aug-06 0:19 
Question[Help] MFC ypelib wrappers for MSXML5 Pin
oaks, rbt9-Aug-06 10:10
Memberoaks, rbt9-Aug-06 10:10 
AnswerRe: [Help] MFC ypelib wrappers for MSXML5 Pin
Gerald Schwab9-Aug-06 18:20
MemberGerald Schwab9-Aug-06 18:20 
GeneralRe: [Help] MFC ypelib wrappers for MSXML5 [modified] Pin
oaks, rbt10-Aug-06 8:09
Memberoaks, rbt10-Aug-06 8:09 
GeneralRe: [Help] MFC ypelib wrappers for MSXML5 Pin
Gerald Schwab10-Aug-06 9:21
MemberGerald 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.