Transpose - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Iterator[Trees]

  

Transpose

  

compute the transpose of a tree

 

Calling Sequence

Parameters

Options

Description

Examples

References

Compatibility

Calling Sequence

Transpose(tree, format=fmt)

Parameters

tree

-

seq(rtable)

fmt

-

(optional) A,C,D,E,LR,P,S,Z

Options

• 

format = A,C,D,E,LR,P,S,Z

  

Specifies the format of the tree. The default is LR. See Iterator[Trees] for a description of the formats.

Description

• 

The Transpose command computes the transpose of a tree. The transpose of a binary tree is formed by interchanging left and right links. The transpose of a tree of a given format is computed by converting it to a binary tree, interchanging, then converting back to the specified format.

• 

The tree parameter is the tree.

Examples

withIterator:-Trees:

Generate a random tree with four internal nodes in LR format.

L,RRandom4,format=LR

L,R2300,4000

(1)

Compute its transpose.

TransposeL,R

2000,3040

(2)

References

  

Knuth, Donald Ervin. The Art of Computer Programming, volume 4, fascicle 4; generating all trees, sec. 7.2.1.6, generating all trees, exercise 12, p. 33.

Compatibility

• 

The Iterator[Trees][Transpose] command was introduced in Maple 2016.

• 

For more information on Maple 2016 changes, see Updates in Maple 2016.

See Also

Iterator

Iterator[Trees]

Iterator[Trees][Random]