[Chicago] Counting recursive calls.

Lewit, Douglas d-lewit at neiu.edu
Sat Apr 11 10:44:36 CEST 2015


Hi everyone,

If you've got time could you run my TreeNode_Main.py script.  I think it
runs just fine, but I'm wondering about the number of recursive calls to
generate the binary tree.  That number seems rather large, especially when
you consider that Python's default recursion limit is 1000.  (Although in
my code I change the recursion limit to 2000.)  If my number of recursion
calls is correct, that means then that there's a difference between "number
of recursive calls" and "recursion depth".  But..... what's the
difference?  I thought that "recursion depth" really refers to the number
of recursive calls.....the number of times that a method is called, or.....
the number of times that a method has to call itself?  I'm a little
confused!

Thanks for the advice.

Best,

Douglas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20150411/3b82c600/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TreeNode.py
Type: text/x-python-script
Size: 3933 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/chicago/attachments/20150411/3b82c600/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TreeNode_Main.py
Type: text/x-python-script
Size: 2941 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/chicago/attachments/20150411/3b82c600/attachment-0001.bin>


More information about the Chicago mailing list