From: "Yong-Kwang Goh" Newsgroups: comp.os.msdos.djgpp Subject: Use of recursion Date: Sun, 12 Dec 1999 02:36:48 +0800 Organization: Singapore Telecommunications Ltd Lines: 21 Message-ID: <82vfqn$6ce$1@mango.singnet.com.sg> NNTP-Posting-Host: 58charlie654.singnet.com.sg X-Newsreader: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com I've a function that draws borders around bitmaps to make them appear outset (popup) or inset (sunken). In anyway, it means giving the bitmaps a 3D look if you don't get what I mean. Somehow, it can be programmed to achieve the effect in 2 ways: using recursion or normal looping. Now, I've a dillema -- should I use recursion or looping after all. AFAIK, recursion is a very useful and good programming technique, but one which gobbles up computing resources and *must* be used carefully. Looping is more efficient but usually more complicated than using recursion. I wonder if recursion *is faster* than looping. When should I use recursion since it can be replaced with looping most of the time? Could someone enlighten me on this issue?