CompleteKaryTree

CompleteKaryTree[n]
gives the complete binary tree with n levels.

CompleteKaryTree[n, k]
gives the complete k-ary tree with n levels.

Details and OptionsDetails and Options

  • The complete k-ary tree with n levels is a rooted tree with k branches at each node and n levels deep.
  • The complete k-ary tree with n levels has vertices.
  • CompleteKaryTree[..., DirectedEdges->True] gives a directed complete k-ary tree.
  • CompleteKaryTree takes the same options as Graph.
New in 8
New to Mathematica? Find your learning path »
Have a question? Ask support »