int find(struct node *list, int x, int start); The return value of this recursive function should be the index (position) of x, if x is indeed present in the list. If x is not in the list, it will return ‐1. e.g. if x is the data of the first node, the function should return 0, and so on.
views:
35answers:
1
+1
A:
Dear Osama!
You have two possibilities.
Either you can iterate through the list (with "while") looking for the necessary element and return the found value afterwards, or you can recursively call the same function on the list which contains one element less each step and then look only for the first element of the list. In this case you should call this function unless you have no more elements or you have the necessary element found.
If you provide the code you have created, the society definitely will help you to fix it.
avp
2009-11-27 09:37:04