計程二Practice Problems

Week 11

5/20/2008

 

練習題不用交,但應練習自己做。5/22會在網站上公佈解答,5/27的期中考會考。

 

1.     依上課討論的方法,寫recursive functionsort(int a[ ], int i, int j)a[i], a[i+1], …, a[j]由小到大排序。寫test program來測試你的function

 

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

 

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

 

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