69,336
社区成员
发帖
与我相关
我的任务
分享
void judge(Node *head)
{
Node *p1,*p2;
if(head!=NULL)
{
p1=head;
p2=p1->next;
if(p2==NULL)
{
cout<<"The list is increased!(just one node!)"<<endl;
return;
}
while(p1->data<p2->data&&p2->next!=NULL)
{
p1=p2;
p2=p2->next;
}
if(p1->data<p2->data)
cout<<"The list is increased!"<<endl;
else
cout<<"The list is not increasd!"<<endl;
}
else
cout<<"No node?!"<<endl;
return;
}