Lab 9 Worksheet Linked Lists.docx-Lab 9...
Showing 7-9 out of 9
##### Page 7
In the
loopy
folder within the
lab9
folder
provided starter code for a circularly linked list with an iterator. You will be writing the
prev()
and
push_front()
functions for the
CircularList<T>
class.
Question
Discussion
The CircularList nodes only
have pointers to a next
element. How would we need
to traverse the list to find the
element that comes before a
node n in the list?
Person C
If we were to find the node
that comes before a node n,
what do we know will be true
next
pointers of n
and p?
Node *n = ...;
Node *p = prev(n);
Person D
In the starter code, implement
the
prev()
function so that it
returns a pointer to n’s
previous node. If the list is
empty,
prev()
should return
a nullptr.
Person A
Node *
prev
(Node *n) const {
}

##### Page 8
Question
Complete the diagram above
to represent what the list will
look like after a new node is
pushed to the front of the list.
How did the pointers change
from the original diagram?
Person B
[insert image here]
The
Iterator
custom
constructor is a private
member of the
Iterator
class. Which line allows for
within the
CircularList
class?
Person C
What happens to the member
variables of
CircularList
when we
push_front
onto
an empty list?
Person D
Implement the
push_front()
function.
You may use the
prev()
function if you find it helpful.

##### Page 9
Time with course staff
There is space here for the
Questioner
to record questions for the staff member joining your
call at the end. Make sure you write down your questions even though you're asking them out
loud so that we can tell from your worksheet that the team was actively thinking of questions to
Submit worksheet
The team is responsible for submitting to
by
Thursday, June 11, 2020 at 11:59PM
EDT
. We strongly recommend submitting your worksheet the same day that you meet as a
group!
The Scribe is responsible for making the final submission to Gradescope. You need to add your
other group members to the submission after it is uploaded using this link:

Browse thousands of Study Materials & Solutions from your Favorite Schools
University of Michigan-An...
University_of_Michigan-Ann_Arbor
School:
Programming_and_Introduction_Data_Structures
Course:
Great resource for chem class. Had all the past labs and assignments
Leland P.
Santa Clara University
Introducing Study Plan
Using AI Tools to Help you understand and remember your course concepts better and faster than any other resource.
Find the best videos to learn every concept in that course from Youtube and Tiktok without searching.
Save All Relavent Videos & Materials and access anytime and anywhere
Prepare Smart and Guarantee better grades