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 \(<\) value
\(p=p->n e x t\)
C) NumberList: :printList ( )
Listrode \(* p=\) head while \((p)\)
cout \(<\) value \(p++;\)
D) NumberList: : NumberList ( )
ListNode \(*\) nodePtr, *nextNode;
nodePtr = head; while (nodePtr != NULL)
nextNode \(=\) nodePtr-next nodePtr- \(>\) next \(=\) NULL \(;\) nodePtr \(=\) nextNode;