Assignment 3: CVector and CMap

Due date: Tue Apr 26 11:59 pm - Hard deadline: Thu Apr 28 11:59 pm

Assignment by Julie Zelenski

[Quick Links: Implementation details, Advice page, Grading]

Learning goals

Completing this assignment will provide you with:

  1. a clear understanding of the organization and management of raw memory
  2. extensive practice using low-level void* memory operations
  3. experience implementing a generic void* interface

Your assignment

Last time you were the client of CVector and CMap, this time you will implement CVector and CMap. It's simple enough to understand the goal, but handling the nitty-gritty internals of managing raw memory will stretch your programming skills to the limit. Start early. Draw pictures. Ask questions. Exercise on trivial test cases first. Use gdb and Valgrind early and often. Test more thoroughly than you have ever before in your life.

CVector implementation

CMap implementation

Requirements that apply to both

Grading

Read our page on how assignments are graded for background information on our grading process and policies. A sketch of how the points are going to be allocated:

Functionality (125 points)

Code quality (buckets together weighted to contribute ~30 points)

Here we will read and evaluate your code in areas such as:

Submissions received by the assignment deadline will receive an on-time bonus equal to 5% of the functionality points earned by the submission.

Getting started

The assign3 project contains the source files, our test programs, and a Makefile. Check out the starter project from your cs107 repo using the command

hg clone /afs/ir/class/cs107/repos/assign3/$USER assign3

Finishing

When finished, use submit to turn in your code for grading. The sole output conformance requirement is to be sure there is no output of any kind from your operations. Double-check that you have removed/disabled all print statements-- any extraneous output can interfere with the autotester and cause loss of points.

How did this assignment go for you? Review the post-task self-check.