Dana Vrajitoru
C243/A594 Data Structures

C243/A594 Homework 2

Due date: Monday, September 11, 2019.

Ex. 1. a. Download the following files into a folder especially created for this assignment (don't mix them with the previous homework):
Makefile
main.cc
List.cc
List.h
ListIterator.cc
ListIterator.h
ListNode.cc
ListNode.h
interface.cc
interface.h
general.cc
general.h

If you ssh into your Linux account, you can copy all the files (the whole folder) with the command
cp /home/danav/public_html/teach/c243/p2 ./ -R

Compile the project with the command make and run the program with the command testlist or ./testlist. Note that not all the options in this program are working yet because you will need to supply the code for some of the functions.

b. You will have to supply the code for 7 functions in the class List and for 2 functions in the class ListIterator.

The first function you must write for the ListIterator class is the one finding the location of the minimal number in the list pointed to by the current pointer of the target object. This function should not change the content of the target object. The function returns a ListIterator object that contains the pointer to that node, or NULL if the list was empty. This is the last entry both in the header file and the source file for the ListIterator class.

The second function in the class ListIterator moves forward by a number of steps. It is a repetition of the ++ operation for a given number of steps.

The prototypes for the functions to be written for the class List are preceded by the comment "Functions to be written by the student" and their implementation contains the comment "Code to be supplied by the student."

c. Modify the interface with the following changes:

Notes.