Skip to content

Instantly share code, notes, and snippets.

@oskarth
Last active Aug 29, 2015
Embed
What would you like to do?
Coin change
digraph {
label="Counting change: 100 cents in quarters and dime";
1 [label="100, (10, 25)"];
2 [label="100, 25"];
3 [label="90, (10, 25)"];
4 [label="100, -"];
5 [label="75, 25"];
6 [label="90, 25"];
7 [label="80, (10, 25)"];
a [label="0", shape=box];
b [label="1", shape=box];
c [label="0", shape=box];
d [label="2", shape=box];
e [label="Three ways in total", shape=box];
1 -> 2;
1 -> 3;
2 -> 4;
2 -> 5;
3 -> 6;
3 -> 7;
4 -> a;
5 -> b [style=dotted];
6 -> c [style=dotted];
7 -> d [style=dotted];
a -> e;
b -> e;
c -> e;
d -> e;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment