Learn R Programming

oak (version 0.2.3)

is.binary_tree: Test if a tree is a binary tree

Description

The function is.binary_tree tests if a tree is binary.

Usage

is.binary_tree(x)

Arguments

x

A tree to be tested.

Value

A logical.

Examples

Run this code
# NOT RUN {
## FALSE
is.binary_tree(empty_tree())

## FALSE
tr = r_(s = list(r_("toto"), r_("tata")))
is.binary_tree(tr) # unrooted tree

## TRUE
tr = r_("titi", s = list(r_("toto"), r_("tata")))
is.binary_tree(tr)

# }

Run the code above in your browser using DataLab