Recursion

Individual Post-Class Exercises
  1. Lesson Setup

    1. Start-of-lecture Slides   (Required)

    2. 'Starter' project for the lesson 06 PCEs (VS 2015/2017)

    3.  Please use this link to access the repo with the 'Starter' project for lesson 06 PCEs (VS 2017/2019)

    4. Watch the online videos for this lesson and demonstrate your knowledge (Hand-In)
      You can download a .ZIP of all the videos for this lesson from Microsoft's OneDrive website by opening the folder (click this link to open the folder), then clicking on the "Download" menu item.

  2. Recursion: Figuring Out What Existing, Recursive Code Does

    1. VIDEO:
      OneDrive: Tracing through recursion
      DropBox: Tracing through recursion

      1. Humor: Gru (from Despicable Me) explains an easy-to-make mistake with recursion
    2. Exercise: Recursion By hand: Warm-up #1
      (Link to the exact same code, in an easy-to-print page NOTE: This is in an MS Word file)
    3. Exercise: Recursion By hand: Warm-up #2 (Hand-In)
      You can hand this in however you want - take a picture using your phone & hand in the image file, do the work in Word directly, do the work in something like MS Paint (or the superior, free alternative, Paint.Net), etc, etc)
      (Link to the exact same code, in an easy-to-print page NOTE: This is in an MS Word file)
    4. Exercise: Recursion By hand: Warm-up #3
      (NOTE: This is in an MS Word file, and is ONLY available in a single, easy-to-print page)
    5. Exercise: Recursion By hand: More Complicated
      (NOTE: This is in an MS Word file, and is ONLY available in a single, easy-to-print page)
  3. Recursion: Writing Your Own, Recursive Code

    1. WARNING:
      Please be very careful that your recursive functions stop at some point.
        If your code creates a Stack Overflow Exception (because it never stops recursing) then NUnit will crash.  (There will be a point penalty for code that crashes like this).
    2. VIDEO:
      OneDrive: Writing recursive code: Basic approach
      DropBox: Writing recursive code: Basic approach
    3. VIDEO:
      OneDrive: Writing recursive code: PowR example
      DropBox: Writing recursive code: PowR example
    4. Exercise: Recursively Printing Numbers 1 - 10
    5. Exercise: Recursively Printing Even Numbers (Hand-In)
    6. Exercise: Recursive Power Function
    7. Exercise: Recursive Multiplication (Hand-In)
    8. Exercise: Write Factorial
    9. Exercise: Fibonacci Numbers (And Arrays!)
    10. Exercise: Print a singly linked list recursively (Hand-In)
  4. Last Steps

    1. Hand in your work:
      Starting with this lesson you must hand in your work via GitHub.

      1. Don't forget to commit your Viewing Quiz/Video Outline to your repo on GitHub.com
        Since you're handing in all your work through git/GitHub this week you'll need to add your Viewing Quiz/Video Outline to your GitHub repo.
        You can do this through Visual Studio (and then push it) or through GitHub.com directly - as long as it gets handed in either way is fine

      2. Create and commit a file which tells me your name
        Please create a text file in Visual Studio (or NotePad/Text Editor/etc) and please name the file LASTNAME, FIRSTNAME.txt, where LASTNAME is replaced with your last name and FIRSTNAME is replaced with your first name (based on how you registered at Cascadia).
        This will enable me to know who you are even if it's not clear from your GitHub username.

      3. You do NOT need to hand in an INSTRUCTORFEEDBACK.docx file when handing in work via GitHub.
        It doesn't hurt if you do so feel free to do so if you'd like to.
        I'm going to ignore any that are there.

    2. How to get your feedback from GitHub:
      NOTE: Getting your feedback won't change, so this is the last week that I'm posting instructions about how to do this

      For the weekly exercises that you submit through GitHub you'll need to open an .HTML file to see your feedback.
      We can't do this directly in GitHub so you'll need to download it first, and then open it on your local computer.

      • You should see a file a name similar to  "<YourName>, -, PCE 05, 2020-05-07_06-11-28.html" in your repo.
        Click on this to open it in GitHub.
      • Once you're on the page for the .HTML file find the 'Download' button (on the right side, near-ish to the top)
      • Download it and open it in a browser you should be able to see the feedback.
    3. Make sure that you're working on the next homework assignment.
      Details are listed on the
      homework assignment page.
      The due date is listed on the main page.
    4. Practice what you've learned
      Remember that in order to really learn this stuff you're going to need to practice it.  Go back and redo the exercises from this lesson until you've really got it down.  Go back to the prior lesson(s) and review and redo that.  Make sure that you've really got this stuff in your head (and remember that it gets easier each time you redo the work)!
In-Class Materials:

These materials are used by students in the hybrid class during leture time.  Online students can safely ignore everything in this 'In Class Materials' box.

In-Class Materials:

Instructor's Materials:

Videos recorded during class (of the In-Class Exercises):