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

recursive thinking
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Senior Symposium, Friday

The Weil Zeta Function for Curves Vy Nguyen 3:45, Cleveland L1 Elicitation of Gestures for Image Editing Andreea Bancila 4:15, Cleveland L1

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.

Towers of Hanoi

End of the world in 585 billion years! http:/ / en.wikipedia.org/wiki/Tower_of_Hanoi

1 2 3 Thursday, April 18, 13

slide-2
SLIDE 2

More Recursion Humor

http:/ / www.thinkgeek.com/ images/products/zoom/ b2ae_recursion.jpg

Finding a Path in a Maze

Start End

Recursion!

What are the subproblems? What is the base case?

Take 1 step, then search from that step to the end. Reached the end

4 5 6 Thursday, April 18, 13

slide-3
SLIDE 3

Stacks & Backtracking

Start End

findMazePath(0,0) findMazePath(0,1) findMazePath(0,2) findMazePath(0,3) findMazePath(0,4)

Recursing

Stacks & Backtracking

Start End

findMazePath(0,0) findMazePath(0,1) findMazePath(0,2) findMazePath(0,3) findMazePath(0,4)

Dead end - backtrack

Stacks & Backtracking

Start End

findMazePath(0,0) findMazePath(0,1) findMazePath(0,2) findMazePath(0,3) findMazePath(1,3)

Recurse in a different direction

7 8 9 Thursday, April 18, 13

slide-4
SLIDE 4

Eight Queens

Place 8 queens on a chessboard such that no queen can capture any other queen.

F A I L ! !

Success! Sudoku

10 11 12 Thursday, April 18, 13