Andrei wrote:
Recursion is dangerous if its depth is unchecked. I've recently seen a recursive
quicksort implementation run wild for example, killing the program without any
error message (not in Python, but the principle is the same regardless the
programming language).
I recall an assignment I on
Thanks for all the replies to my "use of recursion" question. I now have six clear situations where recursion would be best. The consensus seems to be that if you have anything that might contain something underneath it(like a main menu with submenus), you have a good recursion candidate.Best,John[
Safe-mail.net> writes:
> If this is too general a question, perhaps you can tell me when NOT to use
recursion(where it would be
> inappropriate or inefficient).
Easy way to kill a Python program:
>>> def a():
... a()
Recursion is dangerous if its depth is unchecked. I've recently seen a r
It is really more of a question of the type of problem and the solution
approach in general. For example, one can find the intersection of two
lines with a simple equation, but that equation depends on the
dimension the lines are in (2D, 3D, ...). If one were working in 2D
space only, the
On Apr 14, 2005, at 21:06, [EMAIL PROTECTED] wrote:
I've seen a couple of nice tutorials on recursion, and a lot of awful
ones. The latter always trot out the fibonacci and factorial examples
for some reason. And that's about it! The good ones showed me how to
trace through recursive calls and g
Quoting "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>:
> If this is too general a question, perhaps you can tell me when NOT to
> use recursion(where it would be inappropriate or inefficient).
In my opinion ---
Some problems are naturally recursive. A good example is traversing data
structures (parti
[EMAIL PROTECTED] wrote:
I've seen a couple of nice tutorials on recursion, and a lot of awful
ones. The latter always trot out the fibonacci and factorial examples
for some reason. And that's about it! The good ones showed me how to
trace through recursive calls and gave me practical examples(t
> What I want to know is this: what are other specific situations where a
> recursive algorithm would be better or easier to program than an
> iterative one?
Hello,
Programs that have to deal with data often have an internal structure that
mimics that data. A program that deals with lists looks
> I know that the Eight Queens puzzle is a good recursion candidate,
> but I don't understand why as yet. I'm still on simple recursion,
> and am just beginning to understand backtracking in a simple
> example, like adding numbers in an array.
If you make a typo when typing an email, do you delet
I've seen a couple of nice tutorials on recursion, and a lot of awful ones. The latter always trot out the fibonacci and factorial examples for some reason. And that's about it! The good ones showed me how to trace through recursive calls and gave me practical examples(tictactoe, magic squares, Tow
10 matches
Mail list logo