Skip to content

Instantly share code, notes, and snippets.

@kunigami
Created August 21, 2017 06:12
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 kunigami/7f0390e443ead67f04c7c6b35c0db7db to your computer and use it in GitHub Desktop.
Save kunigami/7f0390e443ead67f04c7c6b35c0db7db to your computer and use it in GitHub Desktop.
type 'a node = Leaf of 'a | Node of {
element: 'a;
left: 'a node; (* left sub-tree *)
right: 'a node; (* right sub-tree *)
};;
type 'a tree = {size: int; tree: 'a node};;
type 'a t = 'a tree list;;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment