Answered step by step
Verified Expert Solution
Question
1 Approved Answer
how do you write a code for the cs program? A tree can be represented in LISP as follows: if the tree contains a single
how do you write a code for the cs program?
A tree can be represented in LISP as follows: if the tree contains a single leaf node L, it can be represented by atom L if the tree has more than one node and is squarerooted at N, then it can be represented by a list (S1 S2.. Sk) where Si represents the ith subtree of N. Consider for example the following five trees. Their LISP representations are respectively (((1 e) f) t), (5 foo 3.1 -0.2), (1 (foo 3.1) -0.2), (((1 2) (foo 3.1)) (bar -0.2)), and (r (i (g (h t)))). Write a single LISP function, called ANON. It takes a single argument TREE that represents a tree, and returns an anonymized tree with the same structure, but where all symbols and numbers in the tree are replaced by a question mark. The anonymized versions of the trees above are as follows. Test your program on at least these inputs: A tree can be represented in LISP as follows: if the tree contains a single leaf node L, it can be represented by atom L if the tree has more than one node and is squarerooted at N, then it can be represented by a list (S1 S2.. Sk) where Si represents the ith subtree of N. Consider for example the following five trees. Their LISP representations are respectively (((1 e) f) t), (5 foo 3.1 -0.2), (1 (foo 3.1) -0.2), (((1 2) (foo 3.1)) (bar -0.2)), and (r (i (g (h t)))). Write a single LISP function, called ANON. It takes a single argument TREE that represents a tree, and returns an anonymized tree with the same structure, but where all symbols and numbers in the tree are replaced by a question mark. The anonymized versions of the trees above are as follows. Test your program on at least these inputsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started