4 ms·
I think it's a fair question in that it's taught in most algos classes and they don't usually ask it outright, they ask for some variation and want to see that
by kajecounterhack 12y ago
I think it's a fair question in that it's taught in most algos classes and they don't usually ask it outright, they ask for some variation and want to see that you can handle the task of at least recognizing the problem, and then (hopefully) translating. Or at least getting close.
Also there are a couple of ways to approach this, I think it really helps elucidate how a person tackles a tricky problem upfront (does the person try to write the recurrence out first? does the person do the exponential recursive solution and then memoize? does the person visualize this like a graph, a table, or something else?)