|
|
|
Lab 9 Worksheet Linked Lists.docx
Lab_9_Worksheet__Linked_Lists.docx
Showing 7-9 out of 9
Lab 9 Worksheet Linked Lists.docx-Lab 9: Linked L...
Lab_9_Worksheet__Linked_Lists.docx-Lab 9: Linked Lists Due Thursday
Lab 9 Worksheet Linked Lists.docx-...
Lab_9_Worksheet__Linked_Lists.docx-Lab 9: Linked Lists Due Thursday
Page 7
In the
loopy
folder within the
lab9
folder
(which the Scribe has already downloaded), we have
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
Leader
Your Answer
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
about the
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
Discussion Leader
Your Answer
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
this access to this constructor
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
ask.
Your team's question
Summary of staff answer
Submit worksheet
The team is responsible for submitting to
Gradescope
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:
Ace your assessments! Get Better Grades
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:
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
Students also viewed documents
lab 18.docx
lab_18.docx
Course
Course
3
Module5QuizSTA2023.d...
Module5QuizSTA2023.docx.docx
Course
Course
10
Week 7 Test Math302....
Week_7_Test_Math302.docx.docx
Course
Course
30
Chapter 1 Assigment ...
Chapter_1_Assigment_Questions.docx.docx
Course
Course
5
Week 4 tests.docx.do...
Week_4_tests.docx.docx
Course
Course
23
Week 6 tests.docx.do...
Week_6_tests.docx.docx
Course
Course
106