Computer Science, Mathematics, Learning, Learning To Code, Code.
again, we can instantly look up its answer and avoid having to do recursion again (Note that array and hashmap lookup operations are both O(1) time). This process of storing or caching results to be used later is called memoization. public int fibonacci(int n) { int[] memo = new long[n + 1];