CIS 263 |
Lists |
Fall 2019 |
Use this GitHub Classroom link to get started: classroom.github.com/a/Sf99SCHO.
Vector
- Read through the
Vectorcode 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_CHECKinoperator[]? - 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:
resizereserveinserterase
Linked List
- Read through the
Listand make sure you understand how the iterators work. - Answer the following questions:
- What is the key difference between the
iteratorandconst_iterator? (Talk about both the implementation and the behaviors.) - Why is
Listdeclared to be afriendof 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_frontraw_backraw_push_frontraw_push_backraw_insert_in_ordersplice~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
masterbranch. - 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