Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 inputs

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

More Books

Students also viewed these Databases questions

Question

1 . Television News channels importantance of our Life pattern ?

Answered: 1 week ago