GraphTheory[SpecialGraphs] - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Discrete Mathematics : Graph Theory : GraphTheory Package : SpecialGraphs : GraphTheory/SpecialGraphs/CompleteBinaryTree

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

G:=Graph 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

H:=Graph 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

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam