Skip to content

Instantly share code, notes, and snippets.

@oskarth
Last active August 29, 2015 14:01
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 oskarth/e9f2981cbbfb489b2168 to your computer and use it in GitHub Desktop.
Save oskarth/e9f2981cbbfb489b2168 to your computer and use it in GitHub Desktop.
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