Learn R Programming

TSTr (version 1.2)

dimTree: Tree dimensions

Description

Returns a numeric vector with the dimensions of the ternary search tree

Usage

dimTree(tree)

Arguments

tree
an existing ternary search tree.

Value

A numeric vector with the dimensions of the tree.

Details

The first number in the vector is the number of words in the ternary search tree and the second is the number of nodes (each node is a character) in the tree.

See Also

newTree

Examples

Run this code
fruitTree <- newTree(c("apple", "orange","apricot","cherry"))
dimTree(fruitTree)

Run the code above in your browser using DataLab