Question: Use recursion in c++ to finish typedef Nodex NodePtr; size t numofTerms (NodePtr tmpPtr); 9// Task: Count the number of nodes with a nonzero value
typedef Nodex NodePtr; size t numofTerms (NodePtr tmpPtr); 9// Task: Count the number of nodes with a nonzero value in a linked list // Pre: tmpPtr points to the first node of the list, or it is nullptr if // the list is empty // Post: the number of nodes with a nonzero value in the linked list is // returned, and the linked list is unchanged
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
