Question: Computer Science Scala / Mython question. I will give thumb up, thank you! Consider the definition: sealed trait NumTree case class Leaf (k: Int) extends
Computer Science Scala / Mython question. I will give thumb up, thank you!

Consider the definition: sealed trait NumTree case class Leaf (k: Int) extends NumTree case class Node (k: Int, nl: 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, Leat(k1), rChild) f k1 > k-> // Case number 2 case Node(k, ndl@Node(ki,-,-), nd2@Node(k2, 1Child2, rChild2) ) f k-k1 && k .. // case 3 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? What is the value bound to k2p
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
