Question: sealed trait NumTree case class Leaf(k: Int) extends NumTree case class Node (k Int, n1: NumTree, n2: NumTree) extends NumTree And the pattern matching for

 sealed trait NumTree case class Leaf(k: Int) extends NumTree case class

sealed trait NumTree case class Leaf(k: Int) extends NumTree case class Node (k Int, n1: NumTree, n2: NumTree) extends NumTree And the pattern matching for a value v of type NumTree v match case Leaf (k) -> // Case number 1 case Node(k, Leaf(k1), rChild) if k1 >- k // Case number 2 case Node (k, nd1@Node (k1, _ _), nd2@Node (k2, 1child2, rChild2)) if kk1 && case// case 4 Consider the value below which matches case number 2 Node(10, Leaf (20), Leaf (30)) What is the value bound to rChild: enter your answer without whitespaces? What is the value bound to k1: enter your answer without whitespaces? Consider the value that matches case number 3. Node (10, Node (10, Leaf (5), Leaf (5)), Node (30, Leaf (4), Leaf (8))) What is the value bound to nd1 Make sure that there are no white spaces in your answer What is the value bound to rChild2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!