How to solve this problem of linked lists.


I want to do a problem that. I am given two linked lists L and P.
write a functions printLots(L,p). such that the elements in L that are in positions specified by P.

for example p = 1,3,5,7. the first,third... elements in L are printed.
Sounds like you've answered your own question. Use the values from P as the index (which you will have to traverse) to print out the elements in L.
Topic archived. No new replies allowed.