Hi guys, I know what's Memoization and how it's used in dynamic programming , but there's still something not understandable for me.
Memoization is primarily used for dynamic programming, for example in Fibonacci sequence we are calling much calls twice, so if we do an array with size n which can save every call that we called before and not to call it again, then we are declining the time complexity !
I understand that, but who said that the time of the calling function is greater than making an array and saving to it the calls? I mean:
without memoization, if I call F(1) once in left tree of recursive, then I will call it again in right tree, so we are calling twice F(1)
with memoization, if I call F(1) once in left tree of recursive, then I will no't call it again in right tree, I just save F(1) and use it again , in other words we are not "calling again F(1)" .
so I claim who said that not "calling again F(1)" will ofcourse reduce the time complexity? in other words why time complexity of using array that saves F(1) call will be smaller than calling F(1) itself?!
thanks alot