ListInsert(myList, node 76)
ListInsert(myList, node 68)
ListPrepend(myList, node 75)
ListPrepend(myList, node 76)
ListPrepend(myList, node 68)
Question 3
pts
In the ListInsertAfter function for singly-linked lists, the curNode parameter is ignored when _____.
Correct!
the list's head pointer is null
the newNode argument is also null
the list has more than 2 items
the list's head and tail pointers point to different nodes
Question 4
pts
Given the singly-linked list (11, 33, 44, 66), identify the commands for inserting 22 and 55, such that the
final list is (11, 22, 33, 44, 55, 66).
ListInsertAfter(list, node 22)
ListInsertAfter(list, node 55)
Correct!
ListInsertAfter(list, node 11, node 22)
ListInsertAfter(list, node 44, node 55)
ListInsertAfter(list, node 11, node 22, node 55)
ListInsertAfter(list, node 0, node 22)
ListInsertAfter(list, node 3, node 55)
Question 5
pts
Which
This study XXX completes
source was downloaded bythe followingfrom
100000900703063 algorithm for inserting
CourseHero.com on 02-12-2026 a newGMT
14:39:11 node into a singly-linked list?
-06:00
https://www.coursehero.com/file/248717024/Quiz-Mid-Term-Exam-1pdf/
, ListInsertAfter(list, curNode, newNode) {
if (list⇢head == null) {
list⇢head = newNode
list⇢tail = newNode
}
else if (curNode == list⇢tail) {
list⇢tail⇢next = newNode
list⇢tail = newNode
}
else {
XXX
}
}
Correct!
newNode⇢next = curNode⇢next
curNode⇢next = newNode
newNode⇢next = curNode⇢next
curNode = newNode
newNode⇢next = null
curNode⇢next = list⇢tail⇢next
newNode⇢next = curNode⇢next
curNode⇢next = null
Question 6
pts
Given the singly-linked list (88, 99), which node will be removed by the ListRemoveAfter(list, node 88)
command?
The head node
The list will be removed.
Correct!
The tail node
No node will be removed.
This study source was downloaded by 100000900703063 from CourseHero.com on 02-12-2026 14:39:11 GMT -06:00
https://www.coursehero.com/file/248717024/Quiz-Mid-Term-Exam-1pdf/
,Question 7
pts
Given the singly-linked list (10, 20, 30, 40, 50, 60), what commands remove 10, 20, and 60, such that
the final list is (30, 40, 50)?
ListRemoveAfter(list, null)
ListRemoveAfter(list, node 20)
ListRemoveAfter(list, node 60)
ListRemoveAfter(list, null)
ListRemoveAfter(list, node 10)
ListRemoveAfter(list, node 50)
Correct!
ListRemoveAfter(list, null)
ListRemoveAfter(list, null)
ListRemoveAfter(list, node 50)
ListRemoveAfter(list, null)
ListRemoveAfter(list, null)
ListRemoveAfter(list, node 60)
Question 8
pts
Which XXX completes the algorithm to remove a node from the singly-linked list?
ListRemoveAfter(list, curNode) {
if (curNode is null && list⇢head is not null) {
sucNode = list⇢head⇢next
list⇢head = sucNode
if (sucNode is null) {
XXX
}
}
else if (curNode⇢next is not null) {
sucNode = curNode⇢next⇢next
curNode⇢next = sucNode
if (sucNode is null) {
list⇢tail = curNode
}
This study source was downloaded by 100000900703063 from CourseHero.com on 02-12-2026 14:39:11 GMT -06:00
https://www.coursehero.com/file/248717024/Quiz-Mid-Term-Exam-1pdf/
, }
}
Correct!
list⇢tail = null
list⇢head = sucNode
sucNode = list⇢head⇢next
list⇢tail = curNode
Question 9
pts
Given the singly-linked list (80, 81, 82, 83), what is returned from ListSearch(list, 84)?
1
Node 80
Correct!
Null
True
Question 10
pts
Given the singly-linked list (10, 20, 30, 40, 50, 60), ListSearch(list, 30) points the current node pointer to
_____ after checking node 20.
node 10
node 40
node 20
Correct!
node 30
Question 11
pts
ListSearch visits _____ when searching for 83 in the singly-linked list (80, 81, 82, 83).
Correct!
all the nodes
only the first and last nodes
only the last node
only the first node
Question 12
pts
This study source was downloaded by 100000900703063 from CourseHero.com on 02-12-2026 14:39:11 GMT -06:00
https://www.coursehero.com/file/248717024/Quiz-Mid-Term-Exam-1pdf/