int FindMax(struct IntNode *f ) //f為一個單鏈表的表頭指針
{
int x;
if(! f){printf("單鏈表為空\n"),exit(1);}
x=f->data;
f=f->next;
while(f){
if(f->data>x)x=f->data;
f=f->next;
}
return x;
}
補充:假定struct IntNode的結點類型定義為:
struct IntNode{int data;struct IntNode*next;};
函數功能: