Dana Vrajitoru
C243 Data Structures

Homework 1

Due date: Wednesday, January 18, 2012.

Ex. 1. a. Inside your home directory in your Linux account (the default directory when you log on), create a folder for this class with the command
mkdir c243
Change your working directory to this folder using the command
cd c243
Repeat this steps to create a directory called hw1 or something similar and change your working directory to it.

b. Download the following files into the folder you have created for this homework:
Makefile
my_array.h
my_array.cc
main.cc

If you work from a terminal in your Linux account, you can copy them directly doing something like
cp /home/danav/public_html/teach/c243/p1/Makefile ./
and then a similar command for each of the files.

c. Compile the program with the command
make
Test the program with the command
array

Ex. 2. a. Add some functions to the class My_array to do the following operations and with the given prototypes:


b. Modify the main to test the three functions and at least one of the operators. For this, in the main do the following: Remove or comment out any part of the original main that is not relevant to your program.