View the step-by-step solution to:

Please verify that I solve the this practice problem correctly.

Please verify that I solve the this practice problem correctly. Thanks for the help


Suppose that L1 is the list (A (B C) (D)) and L2 is the list (D (F)).Find the value of each of the following LISP expressions:


(a) (CONS 9CAR L2) (CDR L1))

MY ANSWER IS:(CAR(D(F))(CDR(A(BC)(D))

(D(F))(CDR(A(BC)(D))


(b) (LIST (CONS L1 L2))

MY ANSWER IS: (CONS(A(BC)(D))(D(F))))

(A(BC)(D(D)F))



(c) (CDR (LIST L1 'E L2))

MY ANSWER IS: (A(BC)(D)) E (D(F))

Top Answer

 ( a )  (CONS CAR L2) (CDR L1))   = (D (BC)(D)  ( b ) ... View the full answer

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask a homework question - tutors are online