KaryTree

KaryTree[n]

gives a binary tree with n vertices.

KaryTree[n,k]

gives a k-ary tree with n vertices.

Details and Options

Examples

open allclose all

Basic Examples  (2)

Generate a binary tree with 10 vertices:

In[1]:=
Click for copyable input
Out[1]=

Generate a ternary tree with 15 vertices:

In[1]:=
Click for copyable input
Out[1]=

Options  (80)

Applications  (7)

Properties & Relations  (8)

See Also

CompleteKaryTree  TreeGraph  StarGraph  Groupings

Introduced in 2010
(8.0)