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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!