dev-cpp-users Mailing List for Dev-C++ (Page 440)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(15) |
Oct
(115) |
Nov
(154) |
Dec
(258) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(377) |
Feb
(260) |
Mar
(249) |
Apr
(188) |
May
(152) |
Jun
(150) |
Jul
(195) |
Aug
(202) |
Sep
(200) |
Oct
(286) |
Nov
(242) |
Dec
(165) |
| 2002 |
Jan
(245) |
Feb
(241) |
Mar
(239) |
Apr
(346) |
May
(406) |
Jun
(369) |
Jul
(418) |
Aug
(357) |
Sep
(362) |
Oct
(597) |
Nov
(455) |
Dec
(344) |
| 2003 |
Jan
(446) |
Feb
(397) |
Mar
(515) |
Apr
(524) |
May
(377) |
Jun
(387) |
Jul
(532) |
Aug
(364) |
Sep
(294) |
Oct
(352) |
Nov
(295) |
Dec
(327) |
| 2004 |
Jan
(416) |
Feb
(318) |
Mar
(324) |
Apr
(249) |
May
(259) |
Jun
(218) |
Jul
(212) |
Aug
(259) |
Sep
(158) |
Oct
(162) |
Nov
(214) |
Dec
(169) |
| 2005 |
Jan
(111) |
Feb
(165) |
Mar
(199) |
Apr
(147) |
May
(131) |
Jun
(163) |
Jul
(235) |
Aug
(136) |
Sep
(84) |
Oct
(88) |
Nov
(113) |
Dec
(100) |
| 2006 |
Jan
(85) |
Feb
(119) |
Mar
(33) |
Apr
(31) |
May
(56) |
Jun
(68) |
Jul
(18) |
Aug
(62) |
Sep
(33) |
Oct
(55) |
Nov
(19) |
Dec
(40) |
| 2007 |
Jan
(22) |
Feb
(49) |
Mar
(34) |
Apr
(51) |
May
(66) |
Jun
(43) |
Jul
(116) |
Aug
(57) |
Sep
(70) |
Oct
(69) |
Nov
(97) |
Dec
(86) |
| 2008 |
Jan
(32) |
Feb
(47) |
Mar
(106) |
Apr
(67) |
May
(28) |
Jun
(39) |
Jul
(31) |
Aug
(25) |
Sep
(18) |
Oct
(25) |
Nov
(5) |
Dec
(21) |
| 2009 |
Jan
(33) |
Feb
(27) |
Mar
(27) |
Apr
(22) |
May
(22) |
Jun
(10) |
Jul
(17) |
Aug
(9) |
Sep
(21) |
Oct
(13) |
Nov
(4) |
Dec
(11) |
| 2010 |
Jan
(10) |
Feb
(8) |
Mar
(4) |
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(8) |
Oct
(26) |
Nov
(9) |
Dec
(1) |
| 2011 |
Jan
(21) |
Feb
(16) |
Mar
(4) |
Apr
(19) |
May
(26) |
Jun
(9) |
Jul
(6) |
Aug
|
Sep
(4) |
Oct
(3) |
Nov
(2) |
Dec
(1) |
| 2012 |
Jan
(4) |
Feb
(7) |
Mar
(4) |
Apr
|
May
(1) |
Jun
(10) |
Jul
(1) |
Aug
(1) |
Sep
(18) |
Oct
(3) |
Nov
(1) |
Dec
(1) |
| 2013 |
Jan
(4) |
Feb
(2) |
Mar
(15) |
Apr
(6) |
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
(9) |
Dec
|
| 2014 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
(4) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(4) |
| 2015 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(9) |
Nov
(35) |
Dec
(6) |
| 2016 |
Jan
(7) |
Feb
(10) |
Mar
(10) |
Apr
(9) |
May
(13) |
Jun
(9) |
Jul
(1) |
Aug
(3) |
Sep
(3) |
Oct
(1) |
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Robson B. <rob...@su...> - 2003-02-15 15:54:15
|
test |
|
From: <tel...@ya...> - 2003-02-15 14:18:27
|
the thing with factorials is, that it's recursively horrible since the numbers get very big very quicky, ie the space allocation required will be massive. before you even hit 13! or factorial(13) you exceed the limit for the max value for integers. (2,147,483,647) ( http://www.newdream.net/~sage/old/numbers/fact.htm ) of course you could then use floats or double data types etc, but the thing is, iteratively, the space is set aside perhaps once for the factorial, one counter, and once for the answer. e.g. int factorial; int answer=1; int i=0; /*assign factorials, cater for 0!=1 exception */ while (i<factorial) { answer=answer*(factorial-i); i++; } /* then cout or printf or fstream of whatever u want to do with it.. */ recursively however, as mentioned, it works through stack, thing is, each stack level is sorta like the 'run time embodiement' of the called function. sorry, not too good @ this yet... :( basic thing i'm getting @ is, each time the recursed function is called, then the data is passed as it would to any other function, and passing all that data around is obviously gonna be a detriment to performance as has been mentioned. there are things that work better recursively, one example is euclid's agorithm. google search it if u have to, altho i assume most of you would know what it is. last thing, i cant think of an example, but i think any recursion can be handled with a loop, but not all loops can be done via recursion... i dunno, how was i?? please lemme know if i dont know jack :P http://mobile.yahoo.com.au - Yahoo! Mobile - Exchange IMs with Messenger friends on your Telstra or Vodafone mobile phone. |
|
From: Adam M. <up...@in...> - 2003-02-15 10:58:01
|
Hi.
It's quite simple if you know langueage but in your case just follow my
directions.
1. Select menu item (Tools) fourth from right side.
2. Then select second subitem (Environment options). You'll see dialog box.
This is environment setup box.
3. Click on the second tab (Interface).
4. Click on combo box at top right corner (language).
5. Select appropriate language. Endglish should be written originally i mean
"English"
but if not this is 8th item in this combo.
6. Click second button (OK) from right sid at the bootom of dialog box.
Hope it'll help.
upanie.
----- Original Message -----
From: "Parminder Singh Gupta" <par...@po...>
To: <dev...@li...>
Sent: Saturday, February 15, 2003 11:21 AM
Subject: [Dev-C++] (no subject)
> hi all,
> i have just downloaded and installed Dev-C++ 5.0 beta 7 (4.9.7.0) (10
> MB) with Mingw/GCC 2.95.3 on Win XP system. the install went fine
> except that all the menus in the editor are in a language other than
> english & since i cannot follow them, i am u nable to use the program.
> anybody can tell me how to switch everything back to english???
> thanx,
> Parminder
> par...@po...
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
> ----------------------------------------------------------------------
> Powiedz sobie dobre "Dzien dobry"! >>> http://link.interia.pl/f168b
>
>
>
|
|
From: Parminder S. G. <par...@po...> - 2003-02-15 10:22:39
|
hi all, i have just downloaded and installed Dev-C++ 5.0 beta 7 (4.9.7.0) (10 MB) with Mingw/GCC 2.95.3 on Win XP system. the install went fine except that all the menus in the editor are in a language other than english & since i cannot follow them, i am u nable to use the program. anybody can tell me how to switch everything back to english??? thanx, Parminder par...@po... |
|
From: Sean M. <sea...@ya...> - 2003-02-15 05:04:16
|
When I hover my cursor over the name of a variable, a little popup tells me the name and type of the variable, thereby getting in the way of text I was trying to look at. Does anybody know how to turn this off? Peace, Sean __________________________________________________ Do you Yahoo!? Yahoo! Shopping - Send Flowers for Valentine's Day http://shopping.yahoo.com |
|
From: Ioannis V. <no...@ho...> - 2003-02-15 04:18:09
|
A correction:=0D
=0D
=0D
-------Original Message-------=0D
=0D
From: Ioannis Vranos=0D
Date: =D3=DC=E2=E2=E1=F4=EF, 15 =D6=E5=E2=F1=EF=F5=DC=F1=E9=EF=F2 2003 5:=
23:38 =F0=EC=0D
To: Dev-C++ Mailing List=0D
Subject: Nice combination algorithms=0D
=0D
I have been learning C++ for some time and here are 2 nice standard libra=
ry=20
algorithms for combinations. next_permutation() and =0D
=0D
=3D=3D>prev_permutation() defined in <algorithm>. Reference: TC++PL 3 on =
page
545, 18.10).=0D
=0D
=0D
And since they are generic they can be used with whatever kind of objects=
(e
g. .NET objects). An example:=0D
=0D
#include <iostream>=0D
#include <string>=0D
#include <algorithm>=0D
=0D
int main()=0D
{=0D
using namespace std;=0D
=0D
string s=3D"abcd";=0D
=0D
do=0D
cout<<s<<endl;=0D
while(next_permutation(s.begin(), s.end()));=0D
=0D
}=0D
=0D
Ioannis Vranos=0D
=0D
* Programming pages: http://www.noicys.freeurl.com=0D
* Alternative URL: http://run.to/noicys=20
|
|
From: nada <na...@ca...> - 2003-02-14 21:14:14
|
> > I hope someone can help me. I would like to know if there is > > a function, that turns a C++ string, into a null terminated > > C-style character string. Use the .c_str() function. Example: theStr.c_str() <rb> -- Timing has an awful lot to do with the outcome of a rain dance. |
|
From: Ioannis V. <no...@ho...> - 2003-02-14 20:48:12
|
-------Original Message-------=0D =0D From: Per Westermark=0D Date: =D0=E1=F1=E1=F3=EA=E5=F5=DE, 14 =D6=E5=E2=F1=EF=F5=DC=F1=E9=EF=F2 2= 003 10:35:36 =EC=EC=0D To: Ioannis Vranos=0D Cc: dev...@li...=0D Subject: RE: [Dev-C++] recursion=0D =0D Yes recursion devicient in comparison to loop.=0D =0D But factorial is special in thtat it's only a loop.=0D =0D For more advanced problems, you need a loop with a state-saving queue,=0D with continuous push/pop. And then suddenly it isn't possible to easily=0D say which alternative is faster.=0D =0D =0D =0D =3D=3D> I assume you mean for some specific problems. If i needed a queue= i would use the std::queue from the standard library which would not have t= he stack limitations of the system. :)=0D =0D =0D =0D For some problems, the cost of the crecursive call is smaller than the=0D state-checking needed in the loop.=0D =0D =0D =3D=3D> The above statement is very case-specific and also not so specifi= c. :) A more general statement which is always true is that in 100% of cases recursion is more space deficient than iteration. Let's take an example o= f a recursive function with one argument. If we consider the impossible scena= rio that the iterative equivalent of it requires 10 variables, for calculatio= ns of 100 number depth, the recursive will occupy space for 100 variables wh= ile the loop for 10. A more realistic scenario of the above is 100 vs 3-5. Al= so all these calls are stored in the stack.=0D In run-time you get the continuous function calls and the object instantiations.=0D =0D =0D Besides, just about always, the hard-ware controlled overflow checking of= =0D a stack wins over manual check of software-implemented queue.=0D =0D Auto-allocation/deallocation on stack is also hardware-assisted. Just=0D about the only case where a queue allocation matches speed of=0D auto-allocation is when the queue is fixed-size and allocation is just=0D queue_top++;=0D =0D Basically, speed and or memory consumption is normally not too big an=0D issue between the two methods. The most important issue is if you manage=0D to implement the code - and get it bug-free with one of the available=0D alternatives.=0D =0D =0D =3D=3D> I disagree, for generic problem solutions (that is for not specia= l cases specialisations) i consider the space/time deficiency of recursion in comparison to loop very serious. Even for special cases, i still would prefer a loop.=0D =0D =0D Ioannis Vranos=0D =0D * Programming pages: http://www.noicys.freeurl.com=0D * Alternative URL: http://run.to/noicys=20 |
|
From: Per W. <pw...@ia...> - 2003-02-14 20:41:59
|
EMA System email: pw...@ia... Per Westermark web: http://iapetus.neab.net Vargvaegen 174B phone: +46 8 410 17 198 S-906 42 Umeaa Sweden On Fri, 14 Feb 2003, Ioannis Vranos wrote: > -------Original Message------- > > From: Per Westermark > Date: =D0=E1=F1=E1=F3=EA=E5=F5=DE, 14 =D6=E5=E2=F1=EF=F5=DC=F1=E9=EF=F2 2= 003 5:29:34 =EC=EC > To: Louis Godio > Cc: Ioannis Vranos; dev...@li... > Subject: RE: [Dev-C++] recursion > > The factorial is faster and more efficient as a loop. > > In a loop, it may use the input parameter as loop variable, and only need > a temporary for evaluating the product. > > A recursive solution would duplicate the input parameter and a temporary > and a return address for each step of the algorithm. > > That's why faculty is so bad an example when comparing the two solution > methods. While the mathematical definition of the faculty function is > recursive, the actual problem isn't recursive in nature. > > > > =3D=3D> For generic algorithms a recursive solution is always more defici= ent ------For some SIMPLE algorithms, loops may always win. > than the iterative solution. > > In space because every call has its own instances of the local variables = and > also in most cases all the continuous function calls are stored in the st= ack Shared variables area easily stored in a global struct, or in an object. The needed state variables must be kept for a loop solution too, in this case in a queue. > > > In run-time because of the function calls. function call has to be matched against queue push/pop for software-assisted state stack. > > > Ioannis Vranos > > * Programming pages: http://www.noicys.freeurl.com > * Alternative URL: http://run.to/noicys |
|
From: Per W. <pw...@ia...> - 2003-02-14 20:36:56
|
Yes recursion devicient in comparison to loop. But factorial is special in thtat it's only a loop. For more advanced problems, you need a loop with a state-saving queue, with continuous push/pop. And then suddenly it isn't possible to easily say which alternative is faster. For some problems, the cost of the crecursive call is smaller than the state-checking needed in the loop. Besides, just about always, the hard-ware controlled overflow checking of a stack wins over manual check of software-implemented queue. Auto-allocation/deallocation on stack is also hardware-assisted. Just about the only case where a queue allocation matches speed of auto-allocation is when the queue is fixed-size and allocation is just queue_top++; Basically, speed and or memory consumption is normally not too big an issue between the two methods. The most important issue is if you manage to implement the code - and get it bug-free with one of the available alternatives. /Per W On Fri, 14 Feb 2003, Ioannis Vranos wrote: > -------Original Message------- > > From: Louis Godio > Date: =D0=E1=F1=E1=F3=EA=E5=F5=DE, 14 =D6=E5=E2=F1=EF=F5=DC=F1=E9=EF=F2 2= 003 4:57:27 =EC=EC > To: Ioannis Vranos; dev...@li... > Cc: dev...@li... > Subject: RE: [Dev-C++] recursion > > Greets, > Both of your comments raise interesting questions regarding how to > construct efficient run-time code. The simple recursion > factorial(n)=3D n(n-1)..(1); > is easily implemented as either a simple loop or recursion; > BUT could you guys comment on stack space, run-time etc. for a call > like factorial(100) implemented as a recursion compared to a loop ? > > > =3D=3D> Of course. Recursion is very much run-time/space deficient in com= parison > to loop. > > > > Ioannis Vranos > > * Programming pages: http://www.noicys.freeurl.com > * Alternative URL: http://run.to/noicys |
|
From: Ioannis V. <no...@ho...> - 2003-02-14 20:25:15
|
-------Original Message-------=0D =0D From: Per Westermark=0D Date: =D0=E1=F1=E1=F3=EA=E5=F5=DE, 14 =D6=E5=E2=F1=EF=F5=DC=F1=E9=EF=F2 2= 003 5:29:34 =EC=EC=0D To: Louis Godio=0D Cc: Ioannis Vranos; dev...@li...=0D Subject: RE: [Dev-C++] recursion=0D =0D The factorial is faster and more efficient as a loop.=0D =0D In a loop, it may use the input parameter as loop variable, and only need= =0D a temporary for evaluating the product.=0D =0D A recursive solution would duplicate the input parameter and a temporary=0D and a return address for each step of the algorithm.=0D =0D That's why faculty is so bad an example when comparing the two solution=0D methods. While the mathematical definition of the faculty function is=0D recursive, the actual problem isn't recursive in nature.=0D =0D =0D =0D =3D=3D> For generic algorithms a recursive solution is always more defici= ent than the iterative solution. =0D =0D In space because every call has its own instances of the local variables = and also in most cases all the continuous function calls are stored in the st= ack =0D =0D In run-time because of the function calls.=0D =0D =0D Ioannis Vranos=0D =0D * Programming pages: http://www.noicys.freeurl.com=0D * Alternative URL: http://run.to/noicys=20 |
|
From: Ioannis V. <no...@ho...> - 2003-02-14 20:16:53
|
-------Original Message-------=0D =0D From: Louis Godio=0D Date: =D0=E1=F1=E1=F3=EA=E5=F5=DE, 14 =D6=E5=E2=F1=EF=F5=DC=F1=E9=EF=F2 2= 003 4:57:27 =EC=EC=0D To: Ioannis Vranos; dev...@li...=0D Cc: dev...@li...=0D Subject: RE: [Dev-C++] recursion=0D =0D Greets,=0D Both of your comments raise interesting questions regarding how to=0D construct efficient run-time code. The simple recursion=0D factorial(n)=3D n(n-1)..(1); =0D is easily implemented as either a simple loop or recursion;=0D BUT could you guys comment on stack space, run-time etc. for a call =0D like factorial(100) implemented as a recursion compared to a loop ? =0D =0D =0D =3D=3D> Of course. Recursion is very much run-time/space deficient in com= parison to loop.=0D =0D =0D =0D Ioannis Vranos=0D =0D * Programming pages: http://www.noicys.freeurl.com=0D * Alternative URL: http://run.to/noicys=20 |
|
From: Ioannis V. <no...@ho...> - 2003-02-14 20:12:30
|
=0D =0D -------Original Message-------=0D =0D From: Matthew Nuzum=0D Date: =D0=E1=F1=E1=F3=EA=E5=F5=DE, 14 =D6=E5=E2=F1=EF=F5=DC=F1=E9=EF=F2 2= 003 4:05:01 =EC=EC=0D To: 'Santiago'; 'dev-cpp-users-list'=0D Subject: RE: [Dev-C++] recursion=0D =0D Some problems can only easily be solved with recursion. I use it about 2= -3 times per year.=0D =0D =3D=3D> The "only" part is not true.=0D =0D =0D In fact, the last two times I used recursion was when working with hierarchies. One time=0D was reading in and processing files in a series of folders and subfolders= , the second time=0D was taking information from a database (for a shopping cart) and displayi= ng it in a =0D category/subcategory view.=0D =0D =3D=3D> It can be done as a loop too. I am sending attached a console pro= gram that erases all =0D the contents of the disk. It does it using loop. It asks the user for confirmation before it does=0D it. The program was written at the time that i was learning C, so it is n= ot written nicely.=0D I just kept it to remember the old days. :)=0D =0D =0D Ioannis Vranos=0D =0D * Programming pages: http://www.noicys.freeurl.com=0D * Alternative URL: http://run.to/noicys=20 |
|
From: Per W. <pw...@ia...> - 2003-02-14 17:41:05
|
printf("%s\n",string.c_str());
/Per W
On Fri, 14 Feb 2003, Strydom, J. (Jacques) wrote:
> Hello,
>
> I hope someone can help me. I would like to know if there is
> a function, that turns a C++ string, into a null terminated
> C-style character string.
>
> Thank you for any help.
>
> regards
> Jaques Strydom
>
>
> This email and any accompanying attachments may contain confidential and proprietary information. This information is private and protected by law and, accordingly, if you are not the intended recipient, you are requested to delete this entire communication immediately and are notified that any disclosure, copying or distribution, or taking any action based on this information is prohibited.
>
> Emails cannot be guaranteed to be secure or free of errors or viruses. The sender does not accept any liability or responsibility for any interception, corruption, destruction, loss, late arrival or incompleteness of or tampering or interference with any of the information contained in this email or for its incorrect delivery or non-delivery for whatsoever reason or its effect on any electronic device of the recipient.
>
> If verification of this email or any attachment is required, please request a hard-copy version.
>
|
|
From: Strydom, J. (Jacques) <Jac...@ne...> - 2003-02-14 17:29:36
|
Hello, I hope someone can help me. I would like to know if there is a function, that turns a C++ string, into a null terminated C-style character string. Thank you for any help. regards Jaques Strydom This email and any accompanying attachments may contain confidential and proprietary information. This information is private and protected by law and, accordingly, if you are not the intended recipient, you are requested to delete this entire communication immediately and are notified that any disclosure, copying or distribution, or taking any action based on this information is prohibited. Emails cannot be guaranteed to be secure or free of errors or viruses. The sender does not accept any liability or responsibility for any interception, corruption, destruction, loss, late arrival or incompleteness of or tampering or interference with any of the information contained in this email or for its incorrect delivery or non-delivery for whatsoever reason or its effect on any electronic device of the recipient. If verification of this email or any attachment is required, please request a hard-copy version. |
|
From: Igor P. <igo...@po...> - 2003-02-14 15:43:25
|
Hi,
The most important thing about recursion is the fact that
it is equivalent to using a stack - so if someone is using
recursive functions then he is using OS stack - otherwise
he is using a dedicated stack (an array for example).
Which approach to choose depends on the actual
problem that needs to be solved - usually dedicated
stack is faster but the solution is less readable and requires
much more coding.
Best regards
Igor Pierscinski
-----Original Message-----
From: Louis Godio [mailto:lg...@ya...]
Sent: Friday, February 14, 2003 3:57 PM
To: Ioannis Vranos; dev...@li...
Cc: dev...@li...
Subject: RE: [Dev-C++] recursion
Greets,
Both of your comments raise interesting questions regarding how to
construct efficient run-time code. The simple recursion
factorial(n)=3D n(n-1)..(1);=20
is easily implemented as either a simple loop or recursion;
BUT could you guys comment on stack space, run-time etc. for a call=20
like factorial(100) implemented as a recursion compared to a loop ?=20
--- Ioannis Vranos <no...@ho...> wrote:
> -------Original Message-------
> =20
> From: Per Westermark
> Date: =D0=E1n=E1=F3eloT, 14 =D6l=E2ndo=DCn=E9dn 2003 2:38:47 ee
> To: Jaap de Wolff
> Cc: dev...@li...
> Subject: RE: [Dev-C++] recursion
> =20
> I think you got a bit confused about terminology.
>=20
> Looping and iteration is actually the same thing.
>=20
>=20
> =3D=3D> Yes you are right.
>=20
>=20
>=20
> However, recursion is not anything that should be specifically =
avoided.
> It's a question of what problem to solve.
>=20
> The trivial example of the faculty function seems to be the most =
quoted
> example for the use of a loop instead of recursion, but the example is
> quite bad, since it's faculty is easier to implement and runds faster =
as
> a
> loop.
>=20
> There are matematical rules that makes it possible to rewrite any
> iterative function into a recursive function. And in the same way, any
> recursive function may be converted to use state queues to store the
> recursive state.
>=20
> Use recursion when recursion results in faster run-time, or an easier
> implementation. In other cases, select an iterative approach.
>=20
>=20
> =3D=3D> Recursion resulting to faster run-time is something close to =
the
> impossible. I agree with the "easier implementation" + "while it does
> not
> introduce significant run-time and space costs".
>=20
>=20
>=20
> Examples where recursion faster and/or easier:
> - light-tree evaluation in a ray tracer.
> - parsing of mathematical expressions
> - some recursively defined functions, such as Ackerman
> - regular expression pattern matching
>=20
>=20
> =3D=3D> The "faster" thing is tough to prove. I agree with the =
"easier".
>=20
>=20
>=20
> Ioannis Vranos
>=20
> * Programming pages: http://www.noicys.freeurl.com
> * Alternative URL: http://run.to/noicys=20
__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com
-------------------------------------------------------
This SF.NET email is sponsored by: FREE SSL Guide from Thawte
are you planning your Web Server Security? Click here to get a FREE
Thawte SSL guide and find the answers to all your SSL security issues.
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Colin L. <ha...@bl...> - 2003-02-14 15:36:29
|
> Colin, > Which version of DEVC++ contains gcc 3.2 ? > Will it be used for all future updates ? Version 4.9.7.0 does (http://bloodshed.net/dev/devcpp.html), and it will be still used in future versions. Colin > --- Colin Laplace <ha...@bl...> wrote: > > Hi, > > > > Sorry about that problem, i uploaded the missing file > > (http://www.bloodshed.net/dev/gcc32.txt) > > > > Greetings, > > Colin Laplace > > > > > The page http://www.bloodshed.net/dev/index.html contains a link to a > > > > file > > > > > dev/gcc32.txt relating to incompatabilities with GCC 3.2 - > > > > unfortunately > > > > > the file doesn't seem to exist. I'm using gcc 3.2 and the only > > > > problem > > > > > I've had is that only bits of some error messages get extracted by > > > > dev-cpp. > > > > > Is there something more serious? > > > > > > By the way, there is an obvious work-round for the error message > > > > problem - > > > > > don't make mistakes! > > > > > > Simon > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.NET email is sponsored by: FREE SSL Guide from Thawte > > > are you planning your Web Server Security? Click here to get a FREE > > > Thawte SSL guide and find the answers to all your SSL security > > > > issues. > > > > > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en > > > _______________________________________________ > > > Dev-cpp-users mailing list > > > Dev...@li... > > > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > ------------------------------------------------------- > > This SF.NET email is sponsored by: FREE SSL Guide from Thawte > > are you planning your Web Server Security? Click here to get a FREE > > Thawte SSL guide and find the answers to all your SSL security issues. > > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > __________________________________________________ > Do you Yahoo!? > Yahoo! Shopping - Send Flowers for Valentine's Day > http://shopping.yahoo.com |
|
From: Per W. <pw...@ia...> - 2003-02-14 15:30:06
|
Walking a tree - or in this case traversing a directory structure - is a very simple operation, where there isn't really any practical differences between recursive or iterative solutions. You need very little state information to know where to continue with next step of the algorithm. /Per W On Fri, 14 Feb 2003, Matthew Nuzum wrote: > Some problems can only easily be solved with recursion. I use it about > 2-3 times per year. > > > > In fact, the last two times I used recursion was when working with > hierarchies. One time was reading in and processing files in a series > of folders and subfolders, the second time was taking information from a > database (for a shopping cart) and displaying it in a > category/subcategory view. > > > > It's important to understand how it works because when you need it, > you'll save a lot of time. > > > > -- > > Matthew Nuzum > > www.bearfruit.org > > co...@be... > > > > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf Of Santiago > Sent: Thursday, February 13, 2003 10:52 PM > To: dev-cpp-users-list > Subject: [Dev-C++] recursion > > > > Hello all, > > Simple one: how often, critical, and necessary is the usage of C++ > recursion in the "real world" programming field? > > > > Thanks > > San > > |
|
From: Per W. <pw...@ia...> - 2003-02-14 15:27:16
|
The factorial is faster and more efficient as a loop. In a loop, it may use the input parameter as loop variable, and only need a temporary for evaluating the product. A recursive solution would duplicate the input parameter and a temporary and a return address for each step of the algorithm. That's why faculty is so bad an example when comparing the two solution methods. While the mathematical definition of the faculty function is recursive, the actual problem isn't recursive in nature. /Per W On Fri, 14 Feb 2003, Louis Godio wrote: > Greets, > Both of your comments raise interesting questions regarding how to > construct efficient run-time code. The simple recursion > factorial(n)=3D n(n-1)..(1); > is easily implemented as either a simple loop or recursion; > BUT could you guys comment on stack space, run-time etc. for a call > like factorial(100) implemented as a recursion compared to a loop ? > > --- Ioannis Vranos <no...@ho...> wrote: > > -------Original Message------- > > > > From: Per Westermark > > Date: =D0=E1=F1=E1=F3=EA=E5=F5=DE, 14 =D6=E5=E2=F1=EF=F5=DC=F1=E9=EF=F2= 2003 2:38:47 =EC=EC > > To: Jaap de Wolff > > Cc: dev...@li... > > Subject: RE: [Dev-C++] recursion > > > > I think you got a bit confused about terminology. > > > > Looping and iteration is actually the same thing. > > > > > > =3D=3D> Yes you are right. > > > > > > > > However, recursion is not anything that should be specifically avoided. > > It's a question of what problem to solve. > > > > The trivial example of the faculty function seems to be the most quoted > > example for the use of a loop instead of recursion, but the example is > > quite bad, since it's faculty is easier to implement and runds faster a= s > > a > > loop. > > > > There are matematical rules that makes it possible to rewrite any > > iterative function into a recursive function. And in the same way, any > > recursive function may be converted to use state queues to store the > > recursive state. > > > > Use recursion when recursion results in faster run-time, or an easier > > implementation. In other cases, select an iterative approach. > > > > > > =3D=3D> Recursion resulting to faster run-time is something close to th= e > > impossible. I agree with the "easier implementation" + "while it does > > not > > introduce significant run-time and space costs". > > > > > > > > Examples where recursion faster and/or easier: > > - light-tree evaluation in a ray tracer. > > - parsing of mathematical expressions > > - some recursively defined functions, such as Ackerman > > - regular expression pattern matching > > > > > > =3D=3D> The "faster" thing is tough to prove. I agree with the "easier"= =2E > > > > > > > > Ioannis Vranos > > > > * Programming pages: http://www.noicys.freeurl.com > > * Alternative URL: http://run.to/noicys > > > __________________________________________________ > Do you Yahoo!? > Yahoo! Shopping - Send Flowers for Valentine's Day > http://shopping.yahoo.com > > > ------------------------------------------------------- > This SF.NET email is sponsored by: FREE SSL Guide from Thawte > are you planning your Web Server Security? Click here to get a FREE > Thawte SSL guide and find the answers to all your SSL security issues. > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Per W. <pw...@ia...> - 2003-02-14 15:23:15
|
The speed issue is a question of locality of reference, and of knowing the state changes needed to reach a specific state. A recursive algorithm may often know exactly how it came to a specific state, while an iterative algorithm have to pop a state entry from it's queue and then perform some if tests or a switch statement etc to decide how to continue. In a recursive solution, the hardware i.e. the CPU will perform the stack allocation/deallocation and on most modern processors grow the stack when needed. In an interative solution, the manually used queue must either be of fixed size, or perform malloc/free (new/delete) for each state change. Which solution is better has to be decided for each individual problem. /Per W On Fri, 14 Feb 2003, Ioannis Vranos wrote: > -------Original Message------- > > From: Per Westermark > Date: =D0=E1=F1=E1=F3=EA=E5=F5=DE, 14 =D6=E5=E2=F1=EF=F5=DC=F1=E9=EF=F2 2= 003 2:38:47 =EC=EC > To: Jaap de Wolff > Cc: dev...@li... > Subject: RE: [Dev-C++] recursion > > I think you got a bit confused about terminology. > > Looping and iteration is actually the same thing. > > > =3D=3D> Yes you are right. > > > > However, recursion is not anything that should be specifically avoided. > It's a question of what problem to solve. > > The trivial example of the faculty function seems to be the most quoted > example for the use of a loop instead of recursion, but the example is > quite bad, since it's faculty is easier to implement and runds faster as = a > loop. > > There are matematical rules that makes it possible to rewrite any > iterative function into a recursive function. And in the same way, any > recursive function may be converted to use state queues to store the > recursive state. > > Use recursion when recursion results in faster run-time, or an easier > implementation. In other cases, select an iterative approach. > > > =3D=3D> Recursion resulting to faster run-time is something close to the > impossible. I agree with the "easier implementation" + "while it does not > introduce significant run-time and space costs". > > > > Examples where recursion faster and/or easier: > - light-tree evaluation in a ray tracer. > - parsing of mathematical expressions > - some recursively defined functions, such as Ackerman > - regular expression pattern matching > > > =3D=3D> The "faster" thing is tough to prove. I agree with the "easier". > > > > Ioannis Vranos > > * Programming pages: http://www.noicys.freeurl.com > * Alternative URL: http://run.to/noicys |
|
From: Louis G. <lg...@ya...> - 2003-02-14 14:57:27
|
Greets,
Both of your comments raise interesting questions regarding how to
construct efficient run-time code. The simple recursion
factorial(n)= n(n-1)..(1);
is easily implemented as either a simple loop or recursion;
BUT could you guys comment on stack space, run-time etc. for a call
like factorial(100) implemented as a recursion compared to a loop ?
--- Ioannis Vranos <no...@ho...> wrote:
> -------Original Message-------
>
> From: Per Westermark
> Date: ÐáñáóêåõÞ, 14 ÖåâñïõÜñéïò 2003 2:38:47 ìì
> To: Jaap de Wolff
> Cc: dev...@li...
> Subject: RE: [Dev-C++] recursion
>
> I think you got a bit confused about terminology.
>
> Looping and iteration is actually the same thing.
>
>
> ==> Yes you are right.
>
>
>
> However, recursion is not anything that should be specifically avoided.
> It's a question of what problem to solve.
>
> The trivial example of the faculty function seems to be the most quoted
> example for the use of a loop instead of recursion, but the example is
> quite bad, since it's faculty is easier to implement and runds faster as
> a
> loop.
>
> There are matematical rules that makes it possible to rewrite any
> iterative function into a recursive function. And in the same way, any
> recursive function may be converted to use state queues to store the
> recursive state.
>
> Use recursion when recursion results in faster run-time, or an easier
> implementation. In other cases, select an iterative approach.
>
>
> ==> Recursion resulting to faster run-time is something close to the
> impossible. I agree with the "easier implementation" + "while it does
> not
> introduce significant run-time and space costs".
>
>
>
> Examples where recursion faster and/or easier:
> - light-tree evaluation in a ray tracer.
> - parsing of mathematical expressions
> - some recursively defined functions, such as Ackerman
> - regular expression pattern matching
>
>
> ==> The "faster" thing is tough to prove. I agree with the "easier".
>
>
>
> Ioannis Vranos
>
> * Programming pages: http://www.noicys.freeurl.com
> * Alternative URL: http://run.to/noicys
__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com
|
|
From: Matthew N. <co...@be...> - 2003-02-14 14:03:05
|
Some problems can only easily be solved with recursion. I use it about 2-3 times per year. In fact, the last two times I used recursion was when working with hierarchies. One time was reading in and processing files in a series of folders and subfolders, the second time was taking information from a database (for a shopping cart) and displaying it in a category/subcategory view. It's important to understand how it works because when you need it, you'll save a lot of time. -- Matthew Nuzum www.bearfruit.org co...@be... -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Santiago Sent: Thursday, February 13, 2003 10:52 PM To: dev-cpp-users-list Subject: [Dev-C++] recursion Hello all, Simple one: how often, critical, and necessary is the usage of C++ recursion in the "real world" programming field? Thanks San |
|
From: Colin L. <ha...@bl...> - 2003-02-14 13:27:32
|
Hi, Sorry about that problem, i uploaded the missing file (http://www.bloodshed.net/dev/gcc32.txt) Greetings, Colin Laplace > The page http://www.bloodshed.net/dev/index.html contains a link to a file > dev/gcc32.txt relating to incompatabilities with GCC 3.2 - unfortunately > the file doesn't seem to exist. I'm using gcc 3.2 and the only problem > I've had is that only bits of some error messages get extracted by dev-cpp. > Is there something more serious? > > By the way, there is an obvious work-round for the error message problem - > don't make mistakes! > > Simon > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: FREE SSL Guide from Thawte > are you planning your Web Server Security? Click here to get a FREE > Thawte SSL guide and find the answers to all your SSL security issues. > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Ioannis V. <no...@ho...> - 2003-02-14 13:20:52
|
-------Original Message-------=0D =0D From: Per Westermark=0D Date: =D0=E1=F1=E1=F3=EA=E5=F5=DE, 14 =D6=E5=E2=F1=EF=F5=DC=F1=E9=EF=F2 2= 003 2:38:47 =EC=EC=0D To: Jaap de Wolff=0D Cc: dev...@li...=0D Subject: RE: [Dev-C++] recursion=0D =0D I think you got a bit confused about terminology.=0D =0D Looping and iteration is actually the same thing.=0D =0D =0D =3D=3D> Yes you are right.=0D =0D =0D =0D However, recursion is not anything that should be specifically avoided.=0D It's a question of what problem to solve.=0D =0D The trivial example of the faculty function seems to be the most quoted=0D example for the use of a loop instead of recursion, but the example is=0D quite bad, since it's faculty is easier to implement and runds faster as = a=0D loop.=0D =0D There are matematical rules that makes it possible to rewrite any=0D iterative function into a recursive function. And in the same way, any=0D recursive function may be converted to use state queues to store the=0D recursive state.=0D =0D Use recursion when recursion results in faster run-time, or an easier=0D implementation. In other cases, select an iterative approach.=0D =0D =0D =3D=3D> Recursion resulting to faster run-time is something close to the impossible. I agree with the "easier implementation" + "while it does not introduce significant run-time and space costs".=0D =0D =0D =0D Examples where recursion faster and/or easier:=0D - light-tree evaluation in a ray tracer.=0D - parsing of mathematical expressions=0D - some recursively defined functions, such as Ackerman=0D - regular expression pattern matching=0D =0D =0D =3D=3D> The "faster" thing is tough to prove. I agree with the "easier".=0D =0D =0D =0D Ioannis Vranos=0D =0D * Programming pages: http://www.noicys.freeurl.com=0D * Alternative URL: http://run.to/noicys=20 |
|
From: Josu O. <jon...@ao...> - 2003-02-14 12:48:20
|
Hi, I've just installed Dev-cpp 5 beta 7 (release 4.9.7.0), and the shortcuts are created in the directory c:\windows\temp\Bloodshed Dev-C++ This is not the correct place, and I supose it's a bug. Josu |