Enum leetcode_test_utils::tree::diagnosis::TreeError [−][src]
pub enum TreeError {
Nondeterministic(TraversalType, TraversalType),
LeetcodeFormatError,
}Expand description
Error when constructing a binary tree.
Variants
Nondeterministic(TraversalType, TraversalType)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.
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
Auto Trait Implementations
impl RefUnwindSafe for TreeErrorimpl UnwindSafe for TreeError