We now present a function search(list , x) that returns a pointer to the first occurrences of x within the linked list list and the NULL pointer if x does not occur in the linked list. NODEPTR...


This Code print the
first
occurrences of x,


Modify the code to print the
last
occurrences of x  and print how many times it exists? ( with explanation for each line if possible) many thanks.



We now present a function search(list , x) that returns a pointer to the first<br>occurrences of x within the linked list list and the NULL pointer if x does<br>not occur in the linked list.<br>NODEPTR search(NODEPTR list , int x)<br>{<br>NODEPTR p;<br>for(p=list ; p!=NULL; p=p-> link)<br>if (p->info ==x)<br>return (p);<br>return (NULL);<br>}<br>

Extracted text: We now present a function search(list , x) that returns a pointer to the first occurrences of x within the linked list list and the NULL pointer if x does not occur in the linked list. NODEPTR search(NODEPTR list , int x) { NODEPTR p; for(p=list ; p!=NULL; p=p-> link) if (p->info ==x) return (p); return (NULL); }

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here