Introduction - If you have any usage issues, please Google them yourself
Description of the problem ★
LISP is a high-level language, you can use it to that other data structures, such as binary tree. Binary tree by the LISP S-
Expression to that of its rules as follows:
Empty tree = ()
Tree = (Integer left subtree right subtree)
Leaf node = (integer () ())
★ programming tasks
The problem is given by an S-expression LISP decision tree to ask whether there is a leaf node from the root to the path
P, so that all nodes on the path and equal to a given integer I.
★ data entry
Given by the input data file input.txt. Each input data includes multiple sets of data, each data contains an integer I and
An S expression T (on behalf of binary tree), integral I can be with a number of spaces. S expression across multiple lines, may contain redundant
Spaces.
★ output
The results will be output to the file output.txt. If there is a path p, so that the path on all nodes and equal to I,
Then output "yes", otherwise output "no".
Sample input file output file