src/com/michaelho/DynamicProgramming/DP1.java
/**
         * The dynamic programing method used to calculate Fibonacci numbers.
         * The method uses storage to reduced duplicate caluculation
         *
         * @param x The number to be calculated Fibonacci numbers.
         * @return int The results of calculation.
         * */
The dynamic programing method used to calculate Fibonacci numbers.
The method uses storage to reduced duplicate caluculation

@param x The number to be calculated Fibonacci numbers.
@return int The results of calculation.
The dynamic programing method used to calculate Fibonacci numbers . The method uses storage to reduced duplicate caluculation @param x The number to be calculated Fibonacci numbers . @return int The results of calculation .
int dpCount(int x) {
            int[] fArray = new int[x+1];
            fArray[0] = 0;
            fArray[1] = 1;
            for (int i = 2; i <= x; i++) {
                fArray[i] = fArray[i-1] + fArray[i-2];
            }
            return fArray[x];
        }
int dpCount ( int x ) { int [ ] fArray = new int [ x + 1 ] ; fArray [ 0 ] = 0 ; fArray [ 1 ] = 1 ; for ( int i = 2 ; i <= x ; i ++ ) { fArray [ i ] = fArray [ i - 1 ] + fArray [ i - 2 ] ; } return fArray [ x ] ; }
The dynamic programing method used to calculate Fibonacci numbers.
The dynamic programing method used to calculate Fibonacci numbers .