Enum leetcode_test_utils::tree::diagnosis::TreeError[][src]

pub enum TreeError {
    Nondeterministic(TraversalTypeTraversalType),
    LeetcodeFormatError,
}
Expand description

Error when constructing a binary tree.

Variants

Nondeterministic(TraversalTypeTraversalType)

The tree structure cannot be determined by given two order. Theoretically, if every value occurs no more than once, a binary tree can be determined iif its in-order and another(pre-order, post-order or level-order) sequence are provided.

Note that in some special cases a tree can also be determined(eg., pre-order and post-order both are “[1]”), but these cases are not handled and the corresponding Nondeterministic error will be returned.

LeetcodeFormatError

Parsing leetcode-format tree failed. It is either because you miss the square bracket, or if there is an element split by “,” that cannot be parsed to i32.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.