Created
August 20, 2017 23:59
-
-
Save kunigami/12077df4e370d584202cdb59f9e1456d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type 'a tree = Leaf of 'a | Node of { | |
size: int; (* Number of elements/leaves in the tree - not nodes *) | |
left: 'a tree; (* left sub-tree *) | |
right: 'a tree; (* right sub-tree *) | |
};; | |
(* Binary representation of the list *) | |
type 'a digit = Zero | One of 'a tree;; | |
type 'a t = 'a digit list;; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment