CIS 263 |
Lists |
Fall 2019 |
Use this GitHub Classroom link to get started: classroom.github.com/a/Sf99SCHO
.
Vector
- Read through the
Vector
code and make sure you understand:- Why first constructor is marked
explicit
- How the "big 5" methods work
- How the iterator works
- Why first constructor is marked
- Answer the following questions:
- What is the purpose of
#ifndef NO_CHECK
inoperator[]
? - Why does
void push_back(Object&& x)
usestd::move(x)
whilevoid push_back(const Object& x)
simply usesobjects[theSize++] = x;
? - What does
return &objects[0];
do?
- What is the purpose of
- Complete the following methods:
resize
reserve
insert
erase
Linked List
- Read through the
List
and make sure you understand how the iterators work. - Answer the following questions:
- What is the key difference between the
iterator
andconst_iterator
? (Talk about both the implementation and the behaviors.) - Why is
List
declared to be afriend
of the iterator classes? What breaks if this declaration is removed? - Explain how this code works:
return *--end();
(i.e., list/explain the different sub-operations).
- What is the key difference between the
- Complete the following methods:
raw_front
raw_back
raw_push_front
raw_push_back
raw_insert_in_order
splice
~List
(i.e., the destructor)
Submission and grading
- Please fill out this survey (optional):
rit.az1.qualtrics.com/jfe/form/SV_9v6kb51CNdDfYX3
- Submit the written problems in class.
- Make sure all relevant code (including unit tests) is checked in to GitHub by the due date.
- Unless you indicate otherwise, I will assume that the code to be graded is on the
master
branch. - You are expected to fix and re-submit buggy code. Because your code will eventually be correct, your grade will be based primarily on timeliness.
- There is a penalty for each buggy submission.
(Note: Exercises above drawn largely from the Weis text.)
Updated Sunday, 29 September 2019, 4:20 PM