原创 【LeetCode】2. Add Two Numbers C語言

LeetCode解題小結: 原題:給定兩個非空的鏈表,表示兩個非負整數。 數字以相反的順序存儲,每個節點包含一個數字。 兩個數字相加,並將結果作爲鏈表返回。 注意: 兩個數字是反向存儲相加的,例如:342+465=807。        

原创 【LeetCode】 25. Reverse Nodes in k-Group C語言

LeetCode解題心得,歡迎交流! 第二日 /** * Definition for singly-linked list. * struct ListNode { * int val; * struct L

原创 【LeetCode】19. Remove Nth Node From End of List C語言

LeetCode 解題心得,歡迎交流!原題:給定鏈表,從列表的末尾刪除第n個節點並返回其頭。 解題思路:關鍵是如何找到倒數第n個節點,定義兩個指針

原创 【LeetCode】21. Merge Two Sorted Lists C語言

LeetCode解題心得: 原題:合併兩個排序的鏈接列表,並將其作爲新列表返回。 新列表應通過將前兩個列表的節點拼接在一起。 鏈表的歸併:有遞歸和非遞歸兩種方法: 1.非遞歸方法: /** * Definition for singl

原创 Linux ubuntu 基礎操作(2)

<1> 查看當前目錄有哪些文件: “ls”  <2> 查看當前時間: “date” <3> 計算時間:“time” <4> 打開一個文件:“cd /home/” <5> 返回上級目錄 :“cd ..” 注意細節對比:有的地方“/”

原创 【LeetCode】24. Swap Nodes in Pairs C語言

LeetCode解題心得,歡迎交流! 第二日 /** * Definition for singly-linked list. * struct ListNode { * int val; * struct Li

原创 【LeetCode】 61. Rotate List C語言

LeetCode解題心得,歡迎交流! 第二日  /** * Definition for singly-linked list. * struct ListNode { * int val; * struct L

原创 Linux ubuntu 基礎操作(3)

<18>複製文件: “cp hello.c biubiu.c"(複製一份hello.c,並重命名爲biubiu.c) <19> 重命名 : “mv biubiu.c qiaqia.c”           移    動 : “mv q

原创 【LeetCode】 23. Merge k Sorted Lists C語言

LeetCode解題心得,歡迎指正! 原題:合併k個排序的鏈接列表並將其作爲一個排序列表返回。 /** * Definition for singly-linked list. * struct ListNode { *

原创 Linux ubuntu 基礎操作(1)

快捷鍵 "Ctrl+Alt+T" 打開終端。 輸入"lsb_release -a" 查看當前Ubuntu版本。 輸入“uname -a” 查看Linux內核版本。 點贊 收藏 分享 文章舉報

原创 【LeetCode】143. Reorder List C語言

/** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */

原创 【LeetCode】 138. Copy List with Random Pointer C語言

LeetCode解題心得,歡迎交流! 第三日 /** * Definition for singly-linked list with a random pointer. * struct RandomListNode { *

原创 【LeetCode】 237. Delete Node in a Linked List C語言

/** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */

原创 【LeetCode】 109. Convert Sorted List to Binary Search Tree C語言

 LeetCode解題心得,歡迎交流! 第三日 /** * Definition for singly-linked list. * struct ListNode { * int val; * struct L

原创 【LeetCode】 92. Reverse Linked List II C語言

LeetCode解題心得,歡迎交流! 第三日  /** * Definition for singly-linked list. * struct ListNode { * int val; * struct L