Project 4
You cannot submit for this problem because the homework's deadline is due.
EECS 280 Project 4: Web
Due 11:59pm Tuesday June 25, 2024.
Introduction
The learning goals of this project include Container ADTs, Dynamic Memory, The Big Three, Linked Lists, and Iterators. You will gain experience with new
and delete
, constructors and destructors, and the list
data structure.
Starter Files
Here's a short description of each starter file.
File(s) | Description |
---|---|
List.h |
Starter code for the List . |
List_tests.cpp |
Your List unit tests. |
List_compile_check.cpp |
Compile check test for List |
List_public_test.cpp |
A very small test case for List . |
Makefile |
Helper commands for building. |
unit_test_framework.h |
A simple unit-testing framework for you to write your own tests |
Linked list
Implement your doubly linked list in List.h
. List.h
provides prototypes for each function. Because List
is a templated container, function implementations go in List.h
. There is no List.cpp
.
While the List
from lecture was singly linked, this List
is doubly linked.
This List
also contains an iterator interface.
Do not modify the public interface of the List
class. Implement a doubly-linked list. No arrays or vectors, etc. Manage memory allocation so that there are no memory leaks (Leak checking tutorial).
Compile and run the provided compile check and List
tests.
$ make List_compile_check.exe
$ make List_public_test.exe
$ ./List_public_test.exe
Setup
Edit List.h
, adding a function stub for each function prototype in List.h
. Here's an example.
template<typename T>
bool List<T>::empty() const {
assert(false);
}
The List tests should compile and run. The public tests will fail until you implement the functions. The file for your test cases (List_tests.cpp
) will pass because it initially only contains ASSERT_TRUE(true)
.
$ make List_public_test.exe
$ ./List_public_test.exe
$ make List_tests.exe
$ ./List_tests.exe
At this point, we haven't written the List Iterator, so List_compile_check.exe
won't compile. You'll need to take a look at the lecture about iterators and write your own tests. After you do, use the provided compile check like this:
$ make List_compile_check.exe
Submission and grading
Submit these files to the autograder.
- List.h
This project will be autograded for correctness and programming style.
Requirements and restrictions
It is our goal for you to gain practice with good C++ code, classes,
and dynamic memory.
DO | DO NOT |
---|---|
Modify .cpp files and List.h |
Modify other .h files |
For List , make helper member functions private |
Modify the public interface of List |
Use these libraries: <iostream> , <string> , <cassert> , <sstream> , <utility> |
Use other libraries |
Use <list> (and optionally <algorithm> ) in api.cpp |
Use <algorithm> , <list> , or other containers in List.h |
#include a library to use its functions |
Assume that the compiler will find the library for you (some do, some don’t) |
Use C++ strings | Use C-strings |
Send all output to standard out (AKA stdout) by using cout |
Send any output to standard error (AKA stderr) by using cerr |
Pass large structs or classes by reference | Pass large structs or classes by value |
Pass by const reference when appropriate | "I don’t think I’ll modify it ..." |
Use the Address Sanitizer to check for memory errors | "It’s probably fine..." |
Acknowledgments
Original project written by Andrew DeOrio awdeorio@umich.edu, winter 2019.
This document is licensed under a Creative Commons Attribution-NonCommercial 4.0 License. You're free to copy and share this document, but not to sell it. You may not share source code provided with this document.
Project 4
- Status
- Finished
- Problems
- 1
- Open Since
- 2024-06-15 00:00
- DDL
- 2024-06-25 23:59
- Extension
- 72.0 hour(s)