recursive thinking
play

Recursive Thinking Define the solution to a problem in terms of a - PowerPoint PPT Presentation

Senior Symposium, Friday Elicitation of Gestures for The Weil Zeta Function for Image Editing Curves Andreea Bancila Vy Nguyen 4:15, Cleveland L1 3:45, Cleveland L1 1 Recursive Thinking Define the solution to a problem in terms of a


  1. Senior Symposium, Friday Elicitation of Gestures for The Weil Zeta Function for Image Editing Curves Andreea Bancila Vy Nguyen 4:15, Cleveland L1 3:45, Cleveland L1 1 Recursive Thinking Define the solution to a problem in terms of a solution to one or more “smaller” subproblems Define a base case, a subproblem that can be solved directly. 2 Towers of Hanoi End of the world in 585 billion years! http:/ / en.wikipedia.org/wiki/Tower_of_Hanoi 3 Thursday, April 18, 13

  2. More Recursion Humor http:/ / www.thinkgeek.com/ images/products/zoom/ b2ae_recursion.jpg 4 Finding a Path in a Maze Start End 5 Recursion! What are the subproblems? Take 1 step, then search from that step to the end. What is the base case? Reached the end 6 Thursday, April 18, 13

  3. Stacks & Start Backtracking Recursing findMazePath(0,4) findMazePath(0,3) findMazePath(0,2) End findMazePath(0,1) findMazePath(0,0) 7 Stacks & Start Backtracking Dead end - backtrack findMazePath(0,4) findMazePath(0,3) findMazePath(0,2) End findMazePath(0,1) findMazePath(0,0) 8 Stacks & Start Backtracking Recurse in a different direction findMazePath(1,3) findMazePath(0,3) findMazePath(0,2) End findMazePath(0,1) findMazePath(0,0) 9 Thursday, April 18, 13

  4. Eight Queens Place 8 queens on a chessboard such that no queen can capture any other queen. ! ! L I A F 10 Success! 11 Sudoku 12 Thursday, April 18, 13

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