Description: 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
To Search:
File list (Check if you may need any files):
trees
.....\Debug
.....\.....\trees.exe
.....\.....\trees.ilk
.....\.....\trees.obj
.....\.....\trees.pch
.....\.....\trees.pdb
.....\.....\vc60.idb
.....\.....\vc60.pdb
.....\ReadMe.txt
.....\StdAfx.cpp
.....\StdAfx.h
.....\trees.cpp
.....\trees.dsp
.....\trees.dsw
.....\trees.ncb
.....\trees.opt
.....\trees.pdf
.....\trees.plg
.....\trees.ppt
.....\trees.txt