Sha256: d3930608e105a12cc55372fdf2e005f29bfe2cdcc6e7c9ce40032cc20ebebf2c
Contents?: true
Size: 1.07 KB
Versions: 396
Compression:
Stored size: 1.07 KB
Contents
object Zipper { // A zipper for a binary tree. // ??? Zipper[A] ??? // Get a zipper focussed on the root node. def fromTree[A](bt: BinTree[A]): Zipper[A] = ??? // Get the complete tree from a zipper. def toTree[A](zipper: Zipper[A]): BinTree[A] = ??? // Get the value of the focus node. def value[A](zipper: Zipper[A]): A = ??? // Get the left child of the focus node, if any. def left[A](zipper: Zipper[A]): Option[Zipper[A]] = ??? // Get the right child of the focus node, if any. def right[A](zipper: Zipper[A]): Option[Zipper[A]] = ??? // Get the parent of the focus node, if any. def up[A](zipper: Zipper[A]): Option[Zipper[A]] = ??? // Set the value of the focus node. def setValue[A](v: A, zipper: Zipper[A]): Zipper[A] = ??? // Replace a left child tree. def setLeft[A](l: Option[BinTree[A]], zipper: Zipper[A]): Zipper[A] = ??? // Replace a right child tree. def setRight[A](r: Option[BinTree[A]], zipper: Zipper[A]): Zipper[A] = ??? } // A binary tree. case class BinTree[A](value: A, left: Option[BinTree[A]], right: Option[BinTree[A]])
Version data entries
396 entries across 396 versions & 1 rubygems