Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
C

crazy66

@crazy66
About
Posts
4
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • "Advanced programming in the UNIX environment" Book Code
    C crazy66

    Thinks your good answer very much.

    Managed C++/CLI question learning workspace

  • "Advanced programming in the UNIX environment" Book Code
    C crazy66

    #include "apue.h" Did you have the head file? Or Did you have the book source code? It is The 2nd Edition better , but the 1st edition maybe suitably. Thx.

    Managed C++/CLI question learning workspace

  • Please recommend me a com book.
    C crazy66

    I have a good grasp of the c++ language and mfc. Please recommend me a com book. Thank you very much. ;)

    COM c++ com learning

  • How to prevent Quicksort stack overflow?
    C crazy66

    My aim is to learn the data structure, in the QuickSort algorithm . 0.6s to complete the order that is 1 million random numbers. 1. However, if the rand number such as rand ()% 2, such a random number will be occur stack overflow , the problem is very difficult for me , in order to keeping the rapid nature of QuickSort, may I ask how to solve the stack overflow problem. 2. But luckily no stack overflow if the situation is still rand ()% 2, such a random number calculate the time to reach 17s. Thank you very much. Attached on the source code:

    void SwitchNum(int& n1,int& n2)
    {
    int nTemp=n1;
    n1=n2;
    n2=nTemp;
    }

    void QuickSort(int *pnArray,int nSize)
    {
    if (nSize>1)
    {
    int nNum=nSize/2,i=0,j=nSize-1;
    while (i!=j)
    {
    for (;j>nNum;j--)
    {
    if (pnArray[nNum]>pnArray[j])
    {
    SwitchNum(pnArray[nNum],pnArray[j]);
    nNum=j;
    break;
    }
    }
    for (;i <nNum;i++)
    {
    if (pnArray[nNum] <pnArray[i])
    {
    SwitchNum(pnArray[nNum],pnArray[i]);
    nNum=i;
    break;
    }
    }
    }
    QuickSort(pnArray,nNum);
    QuickSort(pnArray+nNum+1,nSize-nNum-1);
    }
    }

    ATL / WTL / STL algorithms data-structures help tutorial question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups