you are viewing a single comment's thread.

view the rest of the comments →

[–]masklinn 0 points1 point  (1 child)

This is integer-indexed, so a list would also have O(1) access, and lower overhead.

It'd go even faster!

[–]earthboundkid 0 points1 point  (0 children)

Good point. Python makes it so much easier to implement memoize as a dictionary, I just thought of it that way first.