Overview | Schedule | Resources | Assignments | Home |
This project will be due by 5 pm, Friday, March 7. To submit your
project, save it in the
pp1
directory located in your directory under
/home/libs/dataStr/students/
on one of the department's Linux machines (this is a shared
directory, so you should be able to reach it from any of the
machines, including oort).
You may work on this project by yourself or in a group of two or three. If you work in a group, be sure to include everyone's name in the comments at the top of each file. Also, be sure you understand the guidelines for group work listed in the syllabus--the fundamental idea is that everyone in the group should understand what everyone else has done, and be able to recreate it on their own.
The project is Programming Exercise 5-42 in the text (pp. 279-280). Note that the instruction for part (c) is misleading; it should read
(c) Use these new operations to implement the following functions:
That is, you should implement the
insertOrder
and
removeDuplicates
functions using the
insert
and
erase
members that you added to the miniVector class in parts (a) and (b).
You should start by creating your
pp1
directory and copying the Makefile and the book's
miniVector
implementation into it (the following commands assume that you start
in your directory under
/home/libs/dataStr/students/
):
mkdir pp1 cd pp1 cp /home/libs/dataStr/examples/Makefile . cp /home/libs/dataStr/ftsoftds/include/d_vector.h minivec.h
The member functions for parts (a) and (b) go in your
minivec.h
file, while the code for parts (c) and (d) should go in a separate
.cc
file in the same directory. Remember to
#include "minivec.h"
from your main program, so that the correct version of miniVector
will be defined, and edit the Makefile to reflect your source,
header, and executable file names.
Here is a sample output:
Original random integers: 11 1 19 6 13 18 17 13 3 4 2 4 13 3 8 Ordered integers using insertOrder: 1 2 3 3 4 4 6 8 11 13 13 13 17 18 19 Unique integers using removeDuplicates: 1 2 3 4 6 8 11 13 17 18 19
Overview | Schedule | Resources | Assignments | Home |
DePauw University,
Computer Science Department,
Spring 2008
Maintained by Brian Howard
(bhoward@depauw.edu
).
Last updated