Chapter 17: Problem 17
Each of the following member functions for performing an operation on a linked
list of type NumberList has at least one error. Explain what is wrong and how
to fix it.
A) NumberList: :printList ( )
while (head)
cout \(<<\) head- \(>\) value head \(=\) head- \(>\) next
B) NumberList: :printList ( )
ListNode \(\star \mathrm{p}=\) head; while \((\mathrm{p}->\text { next })\)
cout \(<
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.