I understand intuitively why in a binary tree there are a minimum of floor(log2(n)) + 1 levels. I was wondering if there is an equivalently straightforward algorithm for the minimum number of levels in an n-ary tree. Say a full/complete ternary tree for example: my intuition tells me this would involve log3(n) somehow but I cannot figure it out.
You can find the formula for an m-ary tree by first checking what the maximum number of nodes is that you can store in a tree with degree m:
2.1m questions
2.1m answers
60 comments
57.0k users