Tuesday, June 10, 2014

Source Code Rekursif Sederhana ( Faktorial, Trianguler Dll )

package TugasFadli;public class rekursif {              double pr(double x, int n) {        if (n == 0) {                      return 1.0;            } else if (n > 0) {                            return (x * pr(x, n - 1));          } else {                   return (1 / pr(x, -n));          }                                }}class triangle {    public static int t (int n)...

Contoh Source Code Buble Sort

package sorting; public class buble {     private long[] arr;     private int jmlData;     public buble(int max) {         arr = new long[max];         jmlData = 0;     }     public void tambah(long nilai) {         arr[jmlData] = nilai;         jmlData++;     }     public void bacaArr() {         for (int i = 0; i < jmlData;...