View the step-by-step solution to:

B - Imagine that we are looking to verify a function that makes a deep copy of a linked list.

B - Imagine that we are looking to verify a function that makes a deep copy of a linked list. That is, the input list is preserved, and a copy is allocated, with the same data elements but appearing in freshly allocated memory cells that don't overlap with the old list. Which of these Hoare triples gives a proper specification?

 

1.    {list(p)} q = copy(p); {list(p) * list(q)}

 

2.    {list(q)} q = copy(p); {list(p) * list(q)}

 

3.    {list(p)} q = copy(p); {list(q)}

 

4.      {list(q)} q = copy(p); {list(p)}

 

 

Recently Asked Questions

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