Click here to Skip to main content
16,014,650 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: refreshing windows Pin
coda_x23-Oct-03 15:54
coda_x23-Oct-03 15:54 
GeneralHelp with random numbers... Pin
Snyp22-Oct-03 15:19
Snyp22-Oct-03 15:19 
GeneralRe: Help with random numbers... Pin
d00_ape23-Oct-03 1:50
sussd00_ape23-Oct-03 1:50 
GeneralRe: Help with random numbers... Pin
David Crow23-Oct-03 4:10
David Crow23-Oct-03 4:10 
QuestionI still have no idea how do we benefit from rescursion? Pin
Link260022-Oct-03 12:55
Link260022-Oct-03 12:55 
AnswerRe: I still have no idea how do we benefit from rescursion? Pin
Michael Dunn22-Oct-03 14:17
sitebuilderMichael Dunn22-Oct-03 14:17 
GeneralRe: I still have no idea how do we benefit from rescursion? Pin
Link260022-Oct-03 14:31
Link260022-Oct-03 14:31 
GeneralRe: I still have no idea how do we benefit from rescursion? Pin
Ravi Bhavnani22-Oct-03 21:52
professionalRavi Bhavnani22-Oct-03 21:52 
Alex Ngai wrote:
Would you kindly make an example for me which the one that can
not be simplified to a loop?


Recursive algorithms are best applied to recursive data structures. As Mike has pointed out, manipulating a tree (which is a recursive data structure) is best done using small recursive functions. Other classic recursive algorithms are parsing, solving mazes, the Knight's Tour and the 9-Queens problem. See any classical CS text for descriptions of these.

That being said, remember that every recursive algorithm can be implemented in a non-recursive manner. In fact that's how all recursivs algorithms are executed in machine code! Converting a recursive algorithm to a non-recursive one basically requires you to manually maintain a stack (which is nothing more than a LIFO collection of state).

/ravi

Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com

GeneralRe: I still have no idea how do we benefit from rescursion? Pin
David Crow23-Oct-03 6:17
David Crow23-Oct-03 6:17 
AnswerRe: I still have no idea how do we benefit from rescursion? Pin
Shog922-Oct-03 21:50
sitebuilderShog922-Oct-03 21:50 
GeneralTemplate question. Pin
WREY22-Oct-03 12:24
WREY22-Oct-03 12:24 
GeneralRe: Template question. Pin
Michael Dunn22-Oct-03 12:38
sitebuilderMichael Dunn22-Oct-03 12:38 
GeneralNeed to refresh property page controls Pin
ElizabethC22-Oct-03 12:04
ElizabethC22-Oct-03 12:04 
GeneralRe: Need to refresh property page controls Pin
David Crow27-Oct-03 8:11
David Crow27-Oct-03 8:11 
GeneralRe: Need to refresh property page controls Pin
ElizabethC27-Oct-03 8:28
ElizabethC27-Oct-03 8:28 
GeneralHTML Help in Chinese Pin
Wolfram Steinke22-Oct-03 11:48
Wolfram Steinke22-Oct-03 11:48 
Generalproblem with thread Pin
Deepak Samuel22-Oct-03 11:35
Deepak Samuel22-Oct-03 11:35 
GeneralRe: problem with thread Pin
Ryan_Roberts22-Oct-03 12:02
Ryan_Roberts22-Oct-03 12:02 
GeneralSystem.SByte* is inaccessible... Pin
almogaver22-Oct-03 11:06
almogaver22-Oct-03 11:06 
QuestionArray of pointers on the heap? Pin
Rickard Andersson2022-Oct-03 9:07
Rickard Andersson2022-Oct-03 9:07 
AnswerRe: Array of pointers on the heap? Pin
David Crow22-Oct-03 9:22
David Crow22-Oct-03 9:22 
GeneralRe: Array of pointers on the heap? Pin
Rickard Andersson2022-Oct-03 9:26
Rickard Andersson2022-Oct-03 9:26 
GeneralRe: Array of pointers on the heap? Pin
Rickard Andersson2022-Oct-03 9:35
Rickard Andersson2022-Oct-03 9:35 
GeneralRe: Array of pointers on the heap? Pin
David Crow22-Oct-03 9:59
David Crow22-Oct-03 9:59 
GeneralRe: Array of pointers on the heap? Pin
Jeryth30-Oct-03 10:54
Jeryth30-Oct-03 10:54 

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.