0
which one is efficient ? calling a fun repeatedly for getting a value ! r storing them in a single variable(allocating space)
eg: calling Time fn/class in any lang fr N times or assigning it to a variable !
3 Answers
+ 5
storing them is definitely faster
+ 4
since they can be easily searched and accessed. You can even use hashing for even faster access If you need to calculate in a small domain plus quite some test cases.
+ 3
tq fr ur response Sahaj !