CompleteBinaryTree - Maple Help

Online Help

All Products    Maple    MapleSim


GraphTheory[SpecialGraphs]

  

CompleteBinaryTree

  

construct complete binary tree

  

CompleteKaryTree

  

construct complete k-ary tree

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

CompleteBinaryTree(n)

CompleteKaryTree(k,n)

Parameters

k

-

positive integer indicating the degree of the root

n

-

positive integer indicating the depth of the tree

Description

• 

The CompleteBinaryTree(n) command constructs the complete binary tree with depth n.

• 

The CompleteKaryTree(k,n) command constructs the complete k-ary tree with depth n for a given k.

Examples

withGraphTheory:

withSpecialGraphs:

GCompleteBinaryTree2

GGraph 1: an undirected unweighted graph with 7 vertices and 6 edge(s)

(1)

EdgesG

1,2,1,5,2,3,2,4,5,6,5,7

(2)

DrawGraphG

HCompleteKaryTree3,2

HGraph 2: an undirected unweighted graph with 13 vertices and 12 edge(s)

(3)

EdgesH

1,2,1,6,1,10,2,3,2,4,2,5,6,7,6,8,6,9,10,11,10,12,10,13

(4)

DrawGraphH

See Also

SpecialGraphs