第1个回答 2008-10-14
int judge (slink *head)
{
slink *p_tr = head->next;
int tem;
int i = 0, j = 0, k = 0, l = 0;
while (p_tr->next != NULL) {
tem = p_tr->data;
p_tr = p_tr->next;
if (tem > p_tr->data)
i ++;
else if (tem == p_tr->data)
k ++;
else
l ++;
j ++;
}
if (i+k == j || l+k == j )
return 1;
else return 0;
}
非递增有序和非递减有序本回答被提问者采纳