I understand that memoization creates stacks and it slows down the speed, but how? and when I shouldn't use memoization? How should I asses that memoization will fail or pass for sure. In a problem, I used memoization, it got me a tle, but then i did the same code, just except i didnt pass the vector reference, instead of this I declared the vector globally and it passed, I dont know why it happened. Since I'm kind of noob in dp now, I've been thinking to execute in both ways: memo and tabular. I reckon that memoization does the same or less number or operations than tabular.
It would be really helpful if you explain me some rte or tle stuff in memoization and why it slows down when stacks increase?
thanks in advance :)