Questions tagged [memoization]

In computing, memoization is an optimization technique used primarily to speed up computer programs by having function calls avoid repeating the calculation of results for previously-processed inputs.

In computing, memoization is an optimization technique used primarily to speed up computer programs by storing the results of expensive function calls and returning the cached result when the same inputs occur again.

This tag should be used for programs that are using memoization.

Source

Wikipedia

1491 questions
-3
votes
1 answer

How to initialize a 2D array with all elements as -1?

I am trying to solve a dynamic programming problem using memoization. I need to declare a 2D array as a global variable and initialise all of its element as -1. Then I am going to use this initialised array in a recursive…
Sachin Kumar
  • 366
  • 1
  • 6
  • 20
-3
votes
1 answer

Finding minimum sum of non consecutive elements

I'm trying to find the minimum sum of non consecutive elements in list, where every time I can jump one cell or two cells. The first cell is not counted in sum. The implementation has to include recursion and memoization. I tried to implement such…
Galc127
  • 175
  • 6
-3
votes
1 answer

Fibonacci Memoization in R

I am trying to implement Fibonacci Sequence using recursive Memoization in R. I have Basic idea on R and trying to implement using them. Here's the code which I tried(not working). rm(list = ls()) ##Clearing Environment ##Fibonacci_using…
Larry
  • 71
  • 5
-4
votes
3 answers

Runtime error in my code

I was trying to implement this problem from SPOJ: http://www.spoj.com/problems/COINS/ using memoization but I keep getting Runtime error and cant figure out why. Here is my code: #include long long int max(long long int a,long long int…
-5
votes
1 answer

node js VS rust but node is faster?

I have a function named grid which is from dynamic programming problem "grid Traveler" I wrote the same function twice in JS and Rust and bench marked 10 million calculations whilst memoizing both functions JS: const grid = (m, n, memo) => { …
-5
votes
2 answers

is Memoization and Cache function execution in javascript are same?

I recently had an interview where I was asked that how could you cache execution of any function? I heard about Functional Caching in Javascript only. I checked on Stack overflow but not getting any idea from this.Is Memorization and Cache function…
NullPointer
  • 7,094
  • 5
  • 27
  • 41
1 2 3
99
100