WLJS LogoWLJS Notebook

TreeQ

TreeQ[tree] yields True if tree is a valid Tree object and False otherwise.

Examples

Check if an expression is a valid tree:

TreeQ[Tree[a, {Tree[b], Tree[c]}]]
(* True *)
TreeQ[{1, 2, 3}]
(* False *)

Please visit the official Wolfram Language Reference for more details.

On this page