Skip to content

Instantly share code, notes, and snippets.

@kunishi
Created January 29, 2014 10:21
Show Gist options
  • Save kunishi/8685201 to your computer and use it in GitHub Desktop.
Save kunishi/8685201 to your computer and use it in GitHub Desktop.
datatype 'label btree =
Empty |
Node of 'label * 'label btree * 'label btree;
fun sumBinTree(Empty) = 0
| sumBinTree(Node(a, left, right)) =
a + sumBinTree(left) + sumBinTree(right);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment