Skip to content

Commit

Permalink
Add an asterisk
Browse files Browse the repository at this point in the history
  • Loading branch information
Janiczek committed Jun 28, 2023
1 parent fa7e7eb commit 0f69fd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion _posts/2023-06-27-fp-pattern-list-of-todos.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ Instead of calling the function `n` times, we add `n` TODOs to the list. We're m

There's an important "sub-genre" of problems that can be done with this general "list of TODOs" shape: searches.

These generally bail out early (as soon as they find a solution), but sometimes need to find a _best_ solution, which then also leads to exhausting all options.
These generally bail out early (as soon as they find a solution), but sometimes need to find a _best_ solution, which then _can_ also lead to exhausting all options.

This is how I first encountered the pattern - Advent of Code has a lot of maze-solving, [Dijkstra's algorithm](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm), flood-fill, optimization problems and so on. If examining one path gives me three more possible paths to take, I just add them as new TODOs into my `todos` stack and then recurse, continuing on to the next TODO.

Expand Down

0 comments on commit 0f69fd0

Please sign in to comment.