DOC PREVIEW
TRINITY CSCI 1321 - Recursion

This preview shows page 1-2 out of 5 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Slide 1Slide 2Slide 3Slide 4Slide 51Recursion3-30-20092Opening Discussion■Do you have any questions about the quiz?■Let's look at solutions to the interclass problem.■Do you have any questions about the assignment?■Do you have any questions about the reading?■ACM Programming Competition3Maze Solving■One of my favorite recursive algorithms is maze solving. This is a special case of graph traversals which are common problems in CS.■We'll use a 2D array of ints as our maze and we can even put this into our drawing program.■A simple warm-up piece of code is flood fill like you would have in a drawing program.■Once we have that we can see how to convert it to do things like find the shortest path through a maze or count all paths through a maze.■We can try to make this nice and graphical as well so it fits properly into our drawing program.4Formula Parsing■Another one of my favorite recursive algorithms is formula parsing. This allows us to have the user type in a function and our code can evaluate it.■We do this through “divide and conquer”. We split the formula in two across the lowest precedence operator then recursively evaluate the two halves.■We can use this to put function plotting or animation into our program if we give it the ability to handle a variable.5Minute Essay■Do you have any questions about recursion? Do you see how it can do things like search a space of possibilities or divide up a problem?■The design for assignment #5 is due Thursday.■Interclass Problem - Write a recursive function that does something we haven't done in


View Full Document

TRINITY CSCI 1321 - Recursion

Documents in this Course
Recursion

Recursion

11 pages

Iterators

Iterators

10 pages

Actors

Actors

9 pages

Recursion

Recursion

15 pages

Recursion

Recursion

10 pages

Threads

Threads

7 pages

Trees

Trees

11 pages

Load more
Download Recursion
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Recursion and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Recursion 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?