Question
a) Write a recursive C function called findMax() that recursively searches two linked lists for the maximum integer. The function returns a pointer to the
a) Write a recursive C function called findMax() that recursively searches two linked lists for the maximum integer. The function returns a pointer to the Node that contains the maximum integer. If the maximum integer occurs more than once, then return a pointer to any of the possible nodes. The lists must also contain an equal number of nodes. Note: the lists may be empty. Assume that struct node is defined as follows:
typedef struct node
{
int data;
struct node *pNext;
} Node;
Use the following function header:
Preconditions: Length(pList1) == Length(pList2); pMax == NULL
Node * findMax(Node *pList1, Node *pList2, Node *pMax)
{
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started