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
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