@@ -0,0 +1,820 @@
+package com.matao.fundamentals.exercises;%0A%0Aimport edu.princeton.cs.algs4.StdOut;%0A%0A/**%0A * Created by matao on 2018/8/22.%0A * %3Cp%3E%0A * Develop a better implementation of F(N) that saves computed values in an array.%0A */%0Apublic class Ex_1_1_19 %7B%0A%0A    public static long%5B%5D F(int N) %7B%0A        long%5B%5D fibonacci = new long%5BN + 1%5D;%0A        if (N == 0) %7B%0A            return fibonacci;%0A        %7D%0A%0A        fibonacci%5B1%5D = 1;%0A        if (N == 1) %7B%0A            return fibonacci;%0A        %7D%0A%0A        for (int i = 2; i %3C= N; i++) %7B%0A            fibonacci%5Bi%5D = fibonacci%5Bi - 1%5D + fibonacci%5Bi - 2%5D;%0A        %7D%0A        return fibonacci;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        long%5B%5D fibonacci = F(50);%0A        for (int N = 0; N %3C fibonacci.length; N++) %7B%0A            StdOut.println(N + %22 %22 + fibonacci%5BN%5D);%0A        %7D%0A    %7D%0A%7D%0A

add solution to exercise 1.1.19