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
Be first to comment
Leave a reply