Sign In | Subscribe
Start learning today, and be successful in your academic & professional career. Start Today!
Loading video...
This is a quick preview of the lesson. For full access, please Log In or Sign up.
For more information, please see full course syllabus of Introduction to Java
  • Discussion

  • Study Guides

  • Download Lecture Slides

  • Table of Contents

  • Related Services

Bookmark and Share
Lecture Comments (3)

0 answers

Post by Daniela Gross on February 8 at 06:00:38 PM

This video did not help at all. There was absolutely no explanation for how to solve recursion problems by hand which is what will be part of the multiple choice part of the exam.

1 answer

Last reply by: Fancong Mo
Thu Apr 21, 2016 5:07 AM

Post by Daniela Gross on February 8 at 05:52:27 PM

how do you solve a recursion problem by hand?

Algorithms: Recursion

  • Recursion is when a method calls itself
  • A recursive call must be made with a different value than the method itself was called with
  • A recursive method must contain a conditional statement that will eventually cause it to exit without calling itself again
  • The case that causes the method to exit without calling itself again is called a base case
  • Calculating factorial numbers is a common recursive algorithm
  • Calculating Fibonacci numbers is a common recursive algorithm

Algorithms: Recursion

Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.

  • Intro 0:00
  • Roadmap 0:09
  • Recursion 0:44
  • Calculating Factorials 2:49
    • n! and How It's Defined
    • Recursive Implementation of the Factorial Function in Java
  • Calculating Factorials 4:34
    • Calculate 4!
    • Factorial Function in Java
  • Calculating Fibonacci Numbers 9:19
    • Fibonacci Numbers Defined
    • Recursive Implementation
    • Implementation in Java
  • Calculating Fibonacci Numbers 11:28
    • Calculate Fibonacci(4)
    • Fibonacci in Java
  • Other Recursive Functions 17:35
  • Other Recursive Functions 21:32
    • Calculate Mystery(4)
    • Mystery in Java
  • Important Considerations 23:49
    • Recursive Methods
  • Summary 26:41