劍指offer面試題24:反轉鏈表

題目:定義一個函數,輸入一個鏈表的頭節點,反轉該鏈表並輸入反轉後鏈表的頭節點。node AC代碼以下:ios #include<iostream> using namespace std; struct ListNode { int val; struct ListNode *next; ListNode(int x): val(x),next(NULL){} }; class Sol
相關文章
相關標籤/搜索