Facebook
From Lousy Matamata, 6 Years ago, written in Scala.
Embed
Download Paste or View Raw
Hits: 260
  1. def lustrzaneOdbicie[A](node: BT[A]): BT[A] = {
  2.     node match{
  3.       case Empty => Empty
  4.       case Node(v, left, right) => Node(v, lustrzaneOdbicie(right), lustrzaneOdbicie(left))
  5.     }
  6. }