Skip to content

Instantly share code, notes, and snippets.

@bradclawsie bradclawsie/bst
Created Mar 19, 2014

Embed
What would you like to do?
balanced search tree
data Tree = Empty | Node Tree Int Tree deriving (Show)
insert n Empty = Node Empty n Empty
insert n (Node l i r) = if n <= i then Node (insert n l) i r else Node l i (insert n r)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.