Open recursion (C++)

In the previous post, we explored how we could leverage open recursion to solve a dynamic programming problem, while keeping the following aspect decoupled: The recurrence relation: the solution to our problem The memoization strategy: indexing into a vector The order in we compute the sub-solutions Today we will see how to apply this trick in... Continue Reading →

Open recursion (Haskell)

There is a large class of problems that we can solve by nice mathematical recurrence relations. The recurrence is usually simple to read, to reason about, and describes the solution with concision. But a naive translation of this recurrence into code will very often lead to a very inefficient algorithm. When the sub-problems of the... Continue Reading →

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: