News for hackers. Stuff that matters.
Re:Data structures and algorithms I actually used while work... by eru on Wednesday July 15, 2020 @05:02AM (#23842816)
In eg Python you can just add a memoization decoration, and get a linear solution from the naive recursive one.

That's pretty neat.

Re:Data structures and algorithms I actually used while work... by dotancohen on Wednesday July 15, 2020 @05:51AM (#23843106)
In almost any language, a hashtable check after the base case check could be used in a similar manner.
Re:Data structures and algorithms I actually used while work... by eru on Wednesday July 15, 2020 @06:34AM (#23843370)
Yes. I just singled out Python, because the language is well-known, and adding the memoization is particularly straight-forward.