15,941,293 members
Home / Discussions / C / C++ / MFC

C / C++ / MFC

 Re: Recursion to normal way iNoor728-Jun-20 11:01 iNoor72 8-Jun-20 11:01
 Re: Recursion to normal way harold aptroot8-Jun-20 11:11 harold aptroot 8-Jun-20 11:11
 Re: Recursion to normal way iNoor728-Jun-20 11:39 iNoor72 8-Jun-20 11:39
 Re: Recursion to normal way Dave Kreskowiak8-Jun-20 16:44 Dave Kreskowiak 8-Jun-20 16:44
 Re: Recursion to normal way kalberts8-Jun-20 10:38 kalberts 8-Jun-20 10:38
 Re: Recursion to normal way iNoor728-Jun-20 11:03 iNoor72 8-Jun-20 11:03
 Re: Recursion to normal way Richard MacCutchan8-Jun-20 21:33 Richard MacCutchan 8-Jun-20 21:33
 Exercise kalberts8-Jun-20 22:31 kalberts 8-Jun-20 22:31
 Trying to evade the problem that you don't understand recursion by rewriting it to non-recursion is never going to work. In my university days, a fellow student realized that he did not fully master recursion - termination in particular. So he defined a small programming problem for himself. After solving the task, he never had any problems with how to terminate a recursion. I think he made an excellent "programming etude", and have spread it out to a lot of people. It goes like this: When you enter the recursive function, you write a line with the number of spaces given by the recursion depth, and then an asterisk. When you leave the recursive function, you do the same. The top level call gives parameters for (a) the maximum recursion depth, which you dive right into, (b) an intermediate recursion depth that you return to, before again recursing to the maximum depth, and (c) the number of times to recurse to the maximum depth and back to the intermediate level, before finally returning to the top level call (i.e. the number of "peaks"). For a call with arguments (5, 3, 3) the ouput should look something like C++ ```* * * * * * * * * * * * * * * * * * * *```The problem statement seems very simple (and it is, for a seasoned recursionist). For an inexperienced programmer, you can usually hear a lot of cursing and re-cursing during the testing
 Re: Exercise Richard MacCutchan8-Jun-20 22:34 Richard MacCutchan 8-Jun-20 22:34
 Re: Exercise Peter_in_27808-Jun-20 22:43 Peter_in_2780 8-Jun-20 22:43
 Re: Exercise kalberts9-Jun-20 2:50 kalberts 9-Jun-20 2:50
 Re: Exercise Richard MacCutchan9-Jun-20 3:39 Richard MacCutchan 9-Jun-20 3:39
 Re: Exercise kalberts9-Jun-20 3:59 kalberts 9-Jun-20 3:59
 Re: Exercise Richard MacCutchan9-Jun-20 4:11 Richard MacCutchan 9-Jun-20 4:11
 Re: Exercise Richard MacCutchan9-Jun-20 4:29 Richard MacCutchan 9-Jun-20 4:29
 Re: Exercise Richard MacCutchan9-Jun-20 20:56 Richard MacCutchan 9-Jun-20 20:56
 Re: Exercise kalberts9-Jun-20 22:08 kalberts 9-Jun-20 22:08
 Re: Exercise Richard MacCutchan9-Jun-20 23:33 Richard MacCutchan 9-Jun-20 23:33
 Is there any opensource version of telnet client library(encrypted) available for windows Member 147721178-Jun-20 2:25 Member 14772117 8-Jun-20 2:25
 Re: Is there any opensource version of telnet client library(encrypted) available for windows Richard MacCutchan8-Jun-20 5:31 Richard MacCutchan 8-Jun-20 5:31
 Efficient way to read/write file manoharbalu7-Jun-20 22:32 manoharbalu 7-Jun-20 22:32
 Re: Efficient way to read/write file CPallini8-Jun-20 1:28 CPallini 8-Jun-20 1:28
 Re: Efficient way to read/write file Greg Utas8-Jun-20 2:23 Greg Utas 8-Jun-20 2:23
 Re: Efficient way to read/write file kalberts8-Jun-20 4:32 kalberts 8-Jun-20 4:32
 Re: Efficient way to read/write file Joe Woodbury8-Jun-20 14:24 Joe Woodbury 8-Jun-20 14:24
 Last Visit: 31-Dec-99 18:00     Last Update: 18-Jul-24 10:47 Refresh ᐊ Prev1...146147148149150151152153154155 Next ᐅ