Learn R Programming

TSTr (version 1.2)

addWord: Adds a single word or string

Description

Adds a single word to an existing ternary search tree

Usage

addWord(tree, string)

Arguments

tree
an existing ternary search tree to add words to.
string
a string of characters to be added to the tree.

Value

An object of class `list` and `tstTree`.

Details

The string of characters is added to the existing tree.

See Also

newTree

Examples

Run this code
fruitTree <- newTree(c("apple", "orange"))
fruitTree <- addWord(fruitTree, "lemon")
dimTree(fruitTree)

Run the code above in your browser using DataLab