Question: Consider our implementation of the binary tree ADT in Lisp. What would happen if we change the representation of a tree node from a three

Consider our implementation of the binary tree ADT in Lisp. What would happen if we change the representation of a tree node from a three element list (L V R) to nested dotted pairs ((L . V) . R) ? Check all that apply.

Select all that apply:

a. We would need to change the primitive functions for the ADT.

b. This implementation would lead to a smaller total number of function calls and be a bit faster.

c. User code that does not directly use the implementation, but uses only our primitive functions, would still work.

d. We would need to switch the left and right subtrees in all calls.

e. User code that directly uses the implementation details would still work.

f. We cannot use dotted pairs, we need to use a list.

g. We would need to change the tree insert function.

h. We would also need to change the representation of an empty tree.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!