Question: 2. Write a function findPos() for a singly-linked list that has the following declaration and precondition: int findPos (struct node *pHead, char fData); The function

2. Write a function findPos() for a singly-linked list that has the following declaration and precondition: int findPos (struct node *pHead, char fData); The function should go through the linked list and see if the character fData exists, if it exists return its position. The first node starts at position 1. If the node is not found in the list the function should return -1. A node, struct node, is defined as follows: struct node { char data; struct node *pNext
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
