Description
This lab focuses on a sample implementation of a simple collection using a chain of linked nodes for physical storage. After completing this lab you should
- Understand the node manipulation required to implement a simple collection.
(This document is available outside of Canvas here.)
Set-up
- Open the
COMP2210/labsdirectory on your Engineering H: drive. (If you didn’t complete the previous lab where you created this directory structure, do so now.) - Create the
lab09directory. - Download the zip file associated with this lab, store it in the
COMP2210/labs/lab09directory, and unzip the file. - Open jGRASP to the
lab09directory.
LinkedBag
This directory contains a node-based implementation of the Bag interface as discussed in lecture. The XML file is a jGRASP Canvas file – layout specification and other settings for pre-configured visualizations of the LinkedBagClient class.
- Open
LinkedBagClientin jGRASP and compile it. - Click on the Run in Canvas button in the toolbar.
- Using the debugger controls, single-step over each statement in
LinkedBagClient. Use the provided Canvas to make sure you understand each part of the code. - Re-run the code, stepping into methods, and creating your own Canvas as needed to make sure that you understand the
LinkedBagimplementation.

