劍指offer——15.反轉鏈表

問題描述: 輸入一個鏈表,反轉鏈表後,輸出新鏈表的表頭 解題思路: 用頭插法,很容易理解 代碼:web /* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } };*/ class Solution { public: ListNode* Rev
相關文章
相關標籤/搜索