11-02 Class Notes CS 107

# 11-02 Class Notes CS 107 - 11-02 Class Notes CS 107 Tuesday...

This preview shows pages 1–4. Sign up to view the full content.

No office hours Friday (11/4). Class on Friday will combine some online notes with part of an online video lecture. See the Friday notes (already posted) for this. Announcements: Questions? Review of Program #5 description Last few examples of intuitive explanations of recursion. First (of 2) samples of a way to think of tracing a recursive program Last Time: Method 2 for tracing a recursive program Other examples of recursion. Today: Recursion Trace (again using Factorial as our example program) 11-02 Class Notes CS 107 Tuesday, November 01, 2011 11:02 AM CS 107 Fall 2011 Page 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Other recursion examples: //Illustrate simple recursion examples. import java.util.Scanner; // for keyboard input public class Recursion1 { Scanner keyboard = new Scanner( System.in); CS 107 Fall 2011 Page 2
// Run all examples public void doAllProblems() { printReverse( 2468); System.out.println(" \n"); recursivePrintReverse( 1357); System.out.println(" \n"); reverseText(); System.out.println(" \n"); System.out.println("f1(8,3) = " + f1(8,3) ); System.out.println("f1(3,8) = " + f1(3,8) ); System.out.println("f2(2,4) = " + f2(2,4) );

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern