Re: Factorial
From: Wes Spikes (MornThdr_at_NOSPAMverizon.net)
Date: 05/21/04
- Next message: Wes Spikes: "Re: Factorial"
- Previous message: Wes Spikes: "Re: Factorial"
- In reply to: Russ Holsclaw: "Re: Factorial"
- Next in thread: Schmidt: "Re: Factorial"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 21 May 2004 22:31:01 GMT
That reason is why I tried to further my knowledge by using Static arrays to
compute and only calc each value once, such that if it was alread calc once,
it just loads it!
-Wes
"Russ Holsclaw" <russ@holsclaw.nyet> wrote in message
news:u$aM3azPEHA.3944@tk2msftngp13.phx.gbl...
> > Here's some advice: even a double can't handle the factorial of
> 171.
> > Here's some more advice: recursion.
>
> And recursion is better because.....?
>
> I've never been able to figure out why computing factorials has
> always been the textbook example for recursion, when it can be
> handled more efficiently with a simple loop.
>
> Recursion is a good tool to use when processing things that are
> organized in a hierarchical or tree-like way. Otherwise, frankly,
> it's just an academic conceit... a form of masturbatory software
> design. Some people, particularly academics who have nothing
> better to do, use recursion because they think it makes them look
> cool. It's rarely if ever more efficient, is frequently
> dangerous, and isn't really as "elegant" as they'd like you to
> believe, either.
>
> I suppose the only reason why textbooks use factorial to
> illustrate recursion is that the resultant number always
> overflows before the call stack does, thus obscuring the reason
> why recursion should be avoided unless it's truly useful.
>
- Next message: Wes Spikes: "Re: Factorial"
- Previous message: Wes Spikes: "Re: Factorial"
- In reply to: Russ Holsclaw: "Re: Factorial"
- Next in thread: Schmidt: "Re: Factorial"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|