Short and sweet in theory, but awful exponential run time!<br>Andy<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Message: 8<br>Date: Sun, 06 Jan 2008 02:33:43 -0600<br>From: &quot;Kenneth P. Stox&quot; &lt;<a href="mailto:ken@stox.org">ken@stox.org</a>&gt;<br>Subject: Re: [Chicago] Python Tutorial 4.6 function fib()<br>To: The Chicago Python Users Group &lt;
<a href="mailto:chicago@python.org">chicago@python.org</a>&gt;<br>Message-ID: &lt;<a href="mailto:1199608423.9450.24.camel@stox.dyndns.org">1199608423.9450.24.camel@stox.dyndns.org</a>&gt;<br>Content-Type: text/plain<br><br>
Welcome to the wonderful world of recursion:<br><br>def fib(n):<br> &nbsp;if n&lt;2:<br> &nbsp; &nbsp;return n<br> &nbsp;else:<br> &nbsp; &nbsp;return fib(n-2)+fib(n-1)<br><br><br><br><br>------------------------------<br><br>_______________________________________________
<br>Chicago mailing list<br><a href="mailto:Chicago@python.org">Chicago@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/chicago" target="_blank">http://mail.python.org/mailman/listinfo/chicago</a><br><br>
<br>End of Chicago Digest, Vol 29, Issue 6<br>**************************************<br></blockquote></div><br><br clear="all"><br>-- <br>Andrew N. Harrington<br> &nbsp;Director of Academic Programs<br> &nbsp;Computer Science Department 
<br> &nbsp;Loyola University Chicago <br> &nbsp;512B Lewis Towers (office) <br> &nbsp;Snail mail to Lewis Towers 416<br> &nbsp;820 North Michigan Avenue<br> &nbsp;Chicago, Illinois 60611<br><br><a href="http://www.cs.luc.edu/~anh">http://www.cs.luc.edu/~anh
</a><br>Phone: 312-915-7999<br>Fax: &nbsp; &nbsp;312-915-7998<br><a href="mailto:gdp@cs.luc.edu">gdp@cs.luc.edu</a> for graduate administration<br><a href="mailto:upd@cs.luc.edu">upd@cs.luc.edu</a> for undergrad administration<br><a href="mailto:aharrin@luc.edu">
aharrin@luc.edu</a> as professor