i had idea - when the problem asks to do O(1) , the tradeoff is to use some other data structure?

i m solving min stack and i just realized there is simple tradeoff - TIME VS SPACE , right?
if we need things fast (aka TIME O(1) ) we usually need to create some other data structure(space)!

where can i read more about this kind of "hacks"?

Comments (0)