Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Implement the following function as a new function for the linked list toolkit.

ID: 642934 • Letter: I

Question

Implement the following function as a new function for the linked list toolkit. (Use the usual node definition with member variables called data and link as defined above.)

size_t count_42s(const node* head_ptr);
    // Precondition: head_ptr is the head pointer of a linked list.
    // The list might be empty or it might be 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.

Explanation / Answer

Hope this may helps you...