Resources

Video 1 - Intro to recursion (using factorial)

Length 12:13 min

A comparison of iterative and recursive implementations of factorial 

  1. Please read and understand the following tutorial:
  2. Calculate Factorial With Java - Iterative and Recursive
    • Consider this article on Geeks for Geeks, for an alternative (more sussinct, but less detailed) approach, that has C# implementation.
  3. Implement your own program, using the two iterative (for and while) and the recursive implements from the tutorial;
    1. You will need to figure out how to:
      • incorporate the functions together with a main() method that enables the user to input a value of n to calculate the factorial of.
      • Give the user the option of the two iterative and the recursive approach (I suggest case).
    2. Record how long each approach takes for increasing values of n.

Video 2 - tree traversal algorithms

Length 6:06 min

Slides

Worksheet

Homework

Activity

Must

  • Watch the video (12:13)
  • Implement the iterative and recursive versions of the factorial program (from the video) in Java.
    • Submit cropped screenshots in a single Word document, showing code and program output.

Could

  • Complete Q1 from the Homework sheet