Skip to content

Instantly share code, notes, and snippets.

@spion
Created October 28, 2018 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spion/4b31ec396c4cbfebede55558f6238891 to your computer and use it in GitHub Desktop.
Save spion/4b31ec396c4cbfebede55558f6238891 to your computer and use it in GitHub Desktop.
```
R__________
/ \
a___ b1__
/ \ / \
a2 b3 a3 b2__
/ \ / \ / \ / \ \
e1 e2 e3 e4 e5 e6 e7 e8 e9
```
Lets say operation is `-`
a contains a2 - b3
a2 = e1 - e2
b3 = e3 - e4
therefore a = (e1 - e2) - (e3 - e4) = e1 - e2 - e3 + e4
the fold is e1 - e2 - e3 - e4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment