Блог пользователя Dontugiveup

Автор Dontugiveup, история, 3 года назад, По-английски

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 :)

Update: would feel better if i got some helping answers along with downvotes if it makes no sense to you guys.

  • Проголосовать: нравится
  • -16
  • Проголосовать: не нравится

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Which problem?

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

exceeding stack limit can cause mle and rte, also the memory accessed in recursion is not clustered as in iterative so i think that adds to the time