[SOLVED] SOLVED: Lab 7 — List Implementation solution

18.99 $

Programming resource
Digital learning resource

This lab gives you practice in working with our implementation of the dslist class that mimics the STL list class. Create a directory/folder named lab7 and download these files into that folder: The implementation of the dslist class is incomplete. In particular, the class is missing the destroy_list private member function that is used by the destructor and the clear member function. The provided test case in lab7.cpp works “fine”, so what’s the problem? Before we fix the problem, let’s use Dr. Memory and/or Valgrind to look at the details more carefully. You should use the memory debugging tools both on your local machine and by submitting the files to the homework server (we have set up a practice space for Lab 7). Study the memory debugger output carefully. The output should match your understanding of the problems caused by the missing destroy_list implementation. Ask a TA if you have any questions. Now write and debug the destroy_list function and then re-run the memory debugger (both locally and on the submission server) to show that the memory problems have been fixed.

Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

Rate this product

This lab gives you practice in working with our implementation of the dslist class that mimics the STL list class. Create a directory/folder named lab7 and download these files into that folder: The implementation of the dslist class is incomplete. In particular, the class is missing the destroy_list private member function that is used by the destructor and the clear member function. The provided test case in lab7.cpp works “fine”, so what’s the problem? Before we fix the problem, let’s use Dr. Memory and/or Valgrind to look at the details more carefully. You should use the memory debugging tools both on your local machine and by submitting the files to the homework server (we have set up a practice space for Lab 7). Study the memory debugger output carefully. The output should match your understanding of the problems caused by the missing destroy_list implementation. Ask a TA if you have any questions. Now write and debug the destroy_list function and then re-run the memory debugger (both locally and on the submission server) to show that the memory problems have been fixed. To complete this checkpoint, show a TA the implementation and memory debugger output before and after writing destroy_list. Checkpoint 2 One subtle difference between the STL list implementation and our version of the dslist class is the behavior of the iterator that represents the end of the list (the value returned by end()). In STL you may decrement the end iterator. For example, you can print the contents of a list in reverse order: std::list

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.