mutual recursion
play

Mutual Recursion Checkout Recursion2 project from SVN Exam 2, - PowerPoint PPT Presentation

Recursion, Efficiency, and the Time-Space Trade Off; Mutual Recursion Checkout Recursion2 project from SVN Exam 2, tomorrow, open-book, open notes Can start at 7:30am if you want extra time Key Topics: o Cohesion o Event-based prog.: o


  1. Recursion, Efficiency, and the Time-Space Trade Off; Mutual Recursion Checkout Recursion2 project from SVN

  2.  Exam 2, tomorrow, open-book, open notes ◦ Can start at 7:30am if you want extra time  Key Topics: o Cohesion o Event-based prog.: o Coupling o ActionListener o Immutable Classes o MouseListener o Side Effects o Inheritance o Abstract classes o static o Scope o Object-oriented design o Interfaces o CRC Cards o Polymorphism o Recursion

  3.  Always have a base e case that doesn’t recurs rse  Make sure recursive case always makes progre gress ss, by solvi ving g a smaller er probl blem em  You go gotta bel eliev eve ◦ Trust in the recursive solution ◦ Just consider one step at a time

  4. 3. Write class name (for static method) or draw 1. Draw box when method starts reference to object (for non-static method) 2. Fill in name and first line no. method name, line number scope box parameters and local variables 5. List every local variable declared 4. List every parameter in the method, but no v values yet and its argument value. 6. Step through the method, update the line number and variable values, draw new frame for new calls Thanks for David Gries for Q1-2 7. “Erase” the frame when the method is done. this technique

  5.  Why does recursive Fibonacci take so long?!?  Can we fix it?

  6.  A deep discovery of computer science  In a wide variety of problems we can tune the solution by varying the amount of storage space used and the amount of computation performed  Studied by “Complexity Theorists”  Used everyday by software engineers Q3

  7.  Two or more methods that call each other repeated Q4

  8.  Hofstadter Female and Male Sequences:  Questions: ◦ How often are the sequences different in the first 50 positions? first 500? first 5000?

  9. Should have completed St Status us Report ort for Cycle 2 and listed User r St Stories ries for Cycle 3

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend