![]() ![]() |
| |||||||||
| Hotspots: Slides and Code TA Corner Comments? Announcements FAQ Static Webspace | ||||||||||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Sana, (b) is wrong. Mark Guzdial |
c)def upDown(word):
if len(word)==1:
print word
return
print word
upDown(word[:-1])
print word
Sana Yousufi| Trace it out, or use the little elves approach. How many people (function invocations) will be standing at the front of the room? Mark Guzdial |
| "One elf for each word"? Did you mean "one elf for each letter"? Mark Guzdial |
| Thank you, Heather! Mark Guzdial |
| Take a look at the recursion slides. Yup, -1 is fine. Mark Guzdial |