CS 302 - Data Structures & Algorithms II - Spring 2005
Homework 18


Loyola College > Department of Computer Science > CS 302 > Homework > Homework 18

Due

Friday, April 15 at the beginning of class

Assignment

  1. Read Handout on Induction
  2. Exercise 1 and 4 in the handout
  3. Consider the following recursive function:
    int p (int x) {
       if (x < 3)
          return x;
       else
          return p(x-1) * p(x-3);
    }
    
    Let m(x) be the number of multiplication operations that the executtion of p(x) preforms.
    1. Write a recursive definition of m(x).
    2. Prove that your answer to Part a is correct by using mathematical induction.