Types

type Node<K, V> = {#leaf : Leaf<K, V>; #internal : Internal<K, V>}

type Data<K, V> = { kvs : [var ?(K, V)]; var count : Nat }

type Internal<K, V> = { data : Data<K, V>; children : [var ?Node<K, V>] }

type Leaf<K, V> = { data : Data<K, V> }

type BTree<K, V> = { var root : Node<K, V>; var size : Nat; order : Nat }