Get your own website
Python
C
Java
 
Python result:
C result:
Java result:
Computing F(6)
Computing F(5)
Computing F(4)
Computing F(3)
Computing F(2)
Computing F(1)
Computing F(0)
F(6) = 8
memo = [0, 1, 1, 2, 3, 5, 8]
Computing F(6)
Computing F(5)
Computing F(4)
Computing F(3)
Computing F(2)
Computing F(1)
Computing F(0)
F(6) = 8
memo = [0, 1, 1, 2, 3, 5, 8]
Computing F(6)
Computing F(5)
Computing F(4)
Computing F(3)
Computing F(2)
Computing F(1)
Computing F(0)
F(6) = 8
memo = [0, 1, 1, 2, 3, 5, 8]