Computer Programming (II)

Programming Assignment 5

June 6, 2007

 

1.         The sequence a(i) is defined below, write a recursive program to compute a(i).

 

2.         The sequence b(i) is defined below, write a recursive program to compute b(i).

 

3.         The sequence c(i) is defined below, write a recursive program to compute c(i).

 

4.         Write a recursive function to find the minimum element in an array.

 

5.         Write a recursive function to find the index of the minimum element in an array.

 

6.         Write a function to sort recursively by first moving the smallest element to the front.

 

7.         Write a recursive function to count the number of even integers in the array recursively.

 

8.         Write a recursive function to compute the sum of an array using the idea of partitioning an array into two parts as evenly as possible.