CIS 351

Lab 12: Recursion

Fall 2018

Overview

The purpose of this lab is to practice correct stack management by writing a recursive function.

Activity

In probability theory "n choose k" is the number of unique ways to choose k items from a set of n. For example "5 choose 3" is 10, because there are 10 unique ways to draw three balls from a set of five (ABC, ABD, ABE, ACD, ACE, ADE, BCD, BCE, BDE, and CDE).

For this lab, you are going to implement n choose k recursively using this formula: n choose k = (n-1 choose k) + (n-1 choose k-1)

n choose k is defined only for positive integers where n ≥ k. By definition

Here is a test class for your function. There is no test file for the driver program. You must test it by hand.

Submission

When you are done:

  1. Demonstrate your code to me
  2. Submit your assembly and test files on Blackboard.

Updated Tuesday, 27 November 2018, 3:32 PM

W3c Validation