.已知strcpy的函式原型:char* strcpy(char* strdest,char* strsrc)其中strdes是目的字串,strsrc是源字串。不呼叫c++/c的字串庫函式,請編寫函式strcpy.
答案:char* strcpy(char* strdes,char* strsrc)
2.已知鍊錶的頭結點head,寫出乙個函式把這個鍊錶逆置
鍊錶的節點資訊如下:
typedef struct node
node; 答:
node* convertlist(node* head)
head->next = r;
head = q;
return head;
}
單鏈表逆置
單鏈表逆置 include include define item num 10 typedef struct tagnode node node linklist create void linklist destroy node head void linklist print node hea...
單鏈表逆置
name 單鏈表逆置 author 巧若拙 date 22 11 14 16 13 description 分別用遞迴和非遞迴兩種方式實現單鏈表 不含頭結點 的逆置 include include include typedef char elemtype typedef int status 函式...
單鏈表逆置
最近在leetcode oj上刷題,將一些演算法題的解法記錄下來,也期待一些新的更好的方法。題目是這樣滴 206.reverse linked list reverse a singly linked list.hint a linked list can be reversed either it...