skip to main
|
skip to sidebar
Java
2009年6月15日 星期一
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)
2009年6月1日 星期一
Lab Modular Sorting
Write a sort method which takes a double array as parameter
and returns the sorted array. Call this method in a main program.
Hint: The lab is a rewriting of Lab Sorting
to make the sorting procedure a reusable method.
Lab Array
Study Display 6.1, and then write a program that can sort numbers in ascending order.
較舊的文章
首頁
訂閱:
文章 (Atom)
link
電子三甲 9526134 李政洵
Favorite Links
石頭
口袋怪獸
Java
蔡阿緒的窩
Yahoo
許小銘
網際網路應用系統設計
標籤
心境
(1)
散文
(1)
FireFox
(1)
First Spot
(1)
Homework
(1)
Lab
(5)
Human, Computing & Accessibility
載入中…
回應
Loading...
標籤
Lab
(5)
FireFox
(1)
First Spot
(1)
Homework
(1)
心境
(1)
散文
(1)
網誌存檔
►
2007
(31)
►
9月
(2)
►
10月
(13)
►
11月
(7)
►
12月
(9)
►
2008
(4)
►
1月
(4)
▼
2009
(42)
►
2月
(4)
►
3月
(19)
►
4月
(5)
►
5月
(9)
▼
6月
(5)
Lab Array
Lab Modular Sorting
Lab Recursive method
Lab Factorial
Lab Hanoi Tower
關於我自己
s9526134
檢視我的完整簡介