java手寫單鏈表 寫一程序,判斷帶頭單鏈表中的結點是否滿足遞減序列,急求?
寫一程序,判斷帶頭單鏈表中的結點是否滿足遞減序列,急求?如果要使用C語言,可以使用以下函數int judgedesc(node*head){If(head==null&;head-> nex
寫一程序,判斷帶頭單鏈表中的結點是否滿足遞減序列,急求?
如果要使用C語言,可以使用以下函數int judgedesc(node*head){If(head==null&;head-> next==null){printf(“this is a empty list”)return 0}否則{node*P=head-> next node*q=P-> next while(q!=null){if(P->num< q->num)返回0 P=P->next q=q->next}返回1}