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
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
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
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
Recommend
More recommend