Utopia
│
首頁
│
JAVA文章
│
網際網路系統 文章
│
電子系網站
│
2008年12月26日 星期五
Lab Hanoi Tower
The pseudocode for Hanoi Tower is as follows:
solve(N, Src, Aux, Dst)
if N is 0 return
solve(N-1, Src, Dst, Aux)
Move N from Src to Dst
solve(N-1, Aux, Src, Dst)
Write the Java program based on the pseudocode in the above.
Lab Factorial
Write a Java program that computes N! where N is a positive integer.
Hint:
public static long factorial(int n)
Lab Recursive Method
Write a recursive method to compute Fibonacci series.
Hint:
1.
fib(n)=fib(n-1)+fib(n-2)
2.
public static long fib(int n)
StaticMethod
Define a Complex class with a static method for computing complex addition. Use (2+3i)+(4+5i) in your test.
Constructor
2008年12月25日 星期四
Overloading
較新的文章
較舊的文章
首頁
訂閱:
文章 (Atom)
RainDog::
載入中…
這裡是超連結
igoogle
電子系網站‧改
網際網路應用設計
JAVA
殺很大的堯堯
電子戰神科科展
胖蘇
Fish的家
阿土
網誌存檔
►
2009
(47)
►
6月
(7)
►
5月
(10)
►
4月
(10)
►
3月
(15)
►
2月
(5)
▼
2008
(28)
▼
12月
(6)
Lab Hanoi Tower
Lab Factorial
Lab Recursive Method
StaticMethod
Constructor
Overloading
►
11月
(6)
►
10月
(10)
►
9月
(6)
新回應
Loading...