Skip to content

Instantly share code, notes, and snippets.

@jordanlewis
Created May 2, 2012 04:22
Show Gist options
  • Save jordanlewis/2573618 to your computer and use it in GitHub Desktop.
Save jordanlewis/2573618 to your computer and use it in GitHub Desktop.
PFDS Binary Tree datatype
sealed abstract class BinaryTree[+T]
case object BinaryTreeLeaf extends BinaryTree[Nothing]
final case class BinaryTreeNode[T](left: BinaryTree[T], value: T, right: BinaryTree[T]) extends BinaryTree[T]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment