逆置鏈表

題目描述 輸入一個鏈表,反轉鏈表後,輸出新鏈表的表頭。 答案 /* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } };*/ class Solution { public:     ListNode* ReverseList(ListNode* pHead) {
相關文章
相關標籤/搜索