CMSC 162 -- Lab 6

Lab 6

Getting Started

Log onto a computer science server making sure to change the port number.

Follow these instructions to get your files ready to start lab.
  • Use wget to download the file at http://cs.longwood.edu/courses/cmsc162/f18/files/lab6.tgz
  • Uncompress the lab6.tgz file by using tar -xvzf lab6.tgz
  • Use ls to see that there is a new directory called lab6
  • Use cd lab6 to change directory to the lab6 directory

The Problem

Implement a linked list.
  1. Implement the set operation
  2. Implement the get operation
  3. Implement a remove operation
  4. Implement a insert operation
  5. Draw out test cases for operation

Implementation

You have been given a files named list.cpp and LinkedList.h which contains some of the code you will need.

  • double get(int index)
  • void set(int index,double val)
  • void remove(int index)
  • void insert(int index,double val) -- if index is less than zero insert at front -- if index is less than size insert in val before the index -- otherwise add to end

Handin

When you are done you need to hand in your lab. The easiest way is to type make handin.

You lab is due at 11:59pm Oct. 2nd 2018.