99 questions/Solutions/70C

From HaskellWiki
< 99 questions‎ | Solutions
Revision as of 03:53, 10 January 2017 by Wizzup (talk | contribs) (categorize)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

(*) Count the nodes of a multiway tree.

nnodes :: Tree a -> Int
nnodes (Node _ ts) = 1 + sum (map nnodes ts)