Skip to content

Commit 5cab99c

Browse files
authored
Merge pull request #101 from PoignardAzur/patch-2
Fix typo in 2021-05-05-stack-monoid-revisited.md
2 parents 1458cca + e49b8b2 commit 5cab99c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

_posts/2021-05-05-stack-monoid-revisited.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ for i in 0..len(input):
4444
')' => stack.pop()
4545
```
4646

47-
Here, every open parenthesis is assigned the index of its parent in the tree, and every close parenthesis is assigned the index of its corresponding open parenthesis. Note that here I've also changed the order so that generating the result happens *before* processing the element. This is analogous to the distinction between inclusive and exclusive prefix sum; generally the same algorithm can be used for both, but sometimes one or the other is more convenient. When compputing bounding boxes, the inclusive version is better, because we want the bounding box of the element, as modified by the clips. But for purely tracking tree structure, the exclusive version is easier.
47+
Here, every open parenthesis is assigned the index of its parent in the tree, and every close parenthesis is assigned the index of its corresponding open parenthesis. Note that here I've also changed the order so that generating the result happens *before* processing the element. This is analogous to the distinction between inclusive and exclusive prefix sum; generally the same algorithm can be used for both, but sometimes one or the other is more convenient. When computing bounding boxes, the inclusive version is better, because we want the bounding box of the element, as modified by the clips. But for purely tracking tree structure, the exclusive version is easier.
4848

4949
An example:
5050

0 commit comments

Comments
 (0)