August 27, 2024
P70C - Count the nodes of a multiway tree.
Write a method nodeCount which counts the nodes of a given multiway tree.
scala
scala> MTree('a', List(MTree('f'))).nodeCount
res0: Int = 2
August 27, 2024
Write a method nodeCount which counts the nodes of a given multiway tree.
scala
scala> MTree('a', List(MTree('f'))).nodeCount
res0: Int = 2
Don't have an account? We will create one for you.
Enter the OTP send to
in seconds.