advbtinq: Using double list to visit vector binary tree

View source: R/advbtvisit.R

advbtinqR Documentation

Using double list to visit vector binary tree

Description

Advanced visiting for the vector binary tree. Return a double list by specific assigment determined by the argument inq.

Usage

advbtinq(x, inq)

Arguments

x

The vector binary tree to be visited. Traversal is acheivable through invalid assignment in desired layer.

inq

An integer double list to determine the location to be visited. The length of inq should be the same as the layers of visited vector binary tree, while all elements in vector in each layer of inq should not over the intrinsic length of visited vector binary tree layer, otherwise all elements will be returned in this layer.

Value

Return a double list according to the argument inq.

See Also

vbtinq, vbtsub, advbtsub.

Examples

#Make vector binary tree:
colnamevbt <- dl2vbt(chrvec2dl(colnames(datatest)))

#Visit by specific assignment:
visit <- list(c(2), c(3:6), c(2,4), 1)
advbtinq(colnamevbt, visit)

#Traversal of the second layers:
visit <- list(c(2), colnamevbt$dims[2]+1, c(2,4), 1)
advbtinq(colnamevbt, visit)

#Invalid assignments in 1st and 3rd layers:
visit <- list(c(3), c(3:6), c(5), 1)
advbtinq(colnamevbt, visit)

CubicZebra/VBTree documentation built on Feb. 3, 2024, 3:42 p.m.