COMP 2210 Lab 7: Array-based Collections solution

$25.00

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (3 votes)

This lab focuses on a sample implementation of a simple collection using an array for physical storage. After completing this lab you should

  • Understand the array manipulation required to implement a simple collection.
  • Understand how to accomplish the array resizing necessary to guarantee that only O(N) memory is required for a collection of N elements.

(This document is available outside of Canvas here.)

Set-up

  1. Open the COMP2210/labs directory on your Engineering H: drive. (If you didn’t complete the previous lab where you created this directory structure, do so now.)
  2. Create the lab07 directory.
  3. Download the zip file associated with this lab, store it in the COMP2210/labs/lab07 directory, and unzip the file.
  4. Open jGRASP to the lab07 directory.

ArrayBag

The ArrayBag directory contains an array-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 ArrayBagClient class.

  1. Open ArrayBagClient in jGRASP and compile it.
  2. Click on the Run in Canvas button in the toolbar.
  3. Using the debugger controls, single-step over each statement in ArrayBagClient. Use the provided Canvas to make sure you understand each part of the code.
  4. Re-run the code, stepping into methods, and creating your own Canvas as needed to make sure that you understand the ArrayBag implementation.