Question: Implement the following function as a new function for the linked list toolkit: size_t count_42s(const node* head_ptr); Refers to p222-248 in Data Structures and Other
Implement the following function as a new function for the linked list toolkit: size_t count_42s(const node* head_ptr);
Refers to p222-248 in Data Structures and Other Objects by Main and Savitch. (Use the usual node definition with member variables called data and link.)
//Precondition: head_ptr is the head pointer of a linked list. The list might be empty or non empty.
//Postcondition: The return value is the number of occurrences of 42 in the data field of a node on the linked list. The list itself is unchanged.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
