WLJS LogoWLJS Notebook

RandomTree

RandomTree[n] gives a pseudorandom tree with n nodes.

  • RandomTree[n, k] gives a list of k pseudorandom trees.
  • RandomTree[n, {k1, k2, ...}] gives a k1×k2×... array of trees.

Examples

Generate a random tree with 10 nodes:

RandomTree[10]

Create multiple random trees:

RandomTree[5, 3]

Generate a random tree with a specific distribution:

RandomTree[12, TreeLayout -> "RadialEmbedding"]

Please visit the official Wolfram Language Reference for more details.

On this page