思路:把h调到尾结点,返回h->date,将返回的值赋给max,然后max和当前的h->date比较,max大将max返回,max小则max=h->date,返回max
递归方程
h->next==0 return h->date
h->next!=0 max=MaxValue(h->next)
if(h->date>max)
max=h->date;
return maxl
运行环境:VS2017
代码实现
#include<stdio.h>
#include<stdlib.h>
typedef struct node
{
int date;
struct node*next;
}ElemSN;
//创建链表
ElemSN*GreatLink(int Date[], int n)
{
int i;
ElemSN*p, *t = 0, *h =