原创 數據結構與算法之美1_數組&鏈表

本系列文章,算是《極客時間》的《數據結構與算法之美》專欄的讀書筆記。 只是一些個人心得與練習,想要得到更詳細更好更系統的學習,請去 極客時間APP訂閱專欄。 跟着專欄學了好久,也該有點成果不是; 正好趁着最後的幾篇練習章節,把之前

原创 [Leetcode]_69 Sqrt(x)

/** * Index: 69 * Title: Sqrt(x) * Author: ltree98 **/ 題意 對於給定的值進行開根號運算 給定的值保證爲非負數 結果取整,捨棄小數部分 我的 思路 利

原创 [Leetcode]_239 Sliding Window Maximum

/** * Index: 239 * Title: Sliding Window Maximum * Author: ltree98 **/ 題意 給定一個數組, 有一個長度爲k的窗口從數組頭部開始向後滑動,每次滑動

原创 [Leetcode]_641 Design Circular Deque

/** * Index: 641 * Title: Design Circular Deque * Author: ltree98 **/ 題意 設計一個環形隊列 支持的操作 MyCircularDeque(k):

原创 [Leetcode]_70_Climbing Stairs

/** * Index: 70 * Title: Climbing Stairs * Author: ltree98 **/ 題意 給定n階臺階,一次可以跨1階或2階,有多少種方法到臺階頂。 注意: 給的n一定是正

原创 [Leetcode]_141 Linked List Cycle

/** * Index: 141 * Title: Linked List Cycle * Author: ltree98 **/ 題意 判斷鏈表是否有環 我的 思路 快慢指針 時間複雜度: O(n) 空間複雜度:

原创 [Leetcode]_169 Majority Element

/** * Index: 169 * Title: Majority Element * Author: ltree98 **/ 題意 給定一個數組,求數組內出現最頻繁的數字。 最頻繁的元素出現次數將大於一半數組長

原创 [Leetcode]_150 Evaluate Reverse Polish Notation

/** * Index: 150 * Title: Evaluate Reverse Polish Notation * Author: ltree98 **/ 題意 計算逆波蘭式(逆波蘭式也可稱作後綴表示法,它將操

原创 [Leetcode]_47 Permutations II

/** * Index: 47 * Title: Permutations II * Author: ltree98 **/ 題意 給定一組數,輸出這些數的全排列(可能會有相同的數字) 我的 思路 上一道題,是針對不

原创 [Leetcode]_46 Permutations

/** * Index: 46 * Title: Permutations * Author: ltree98 **/ 題意 給定一組不同的數,輸出這些數的全排列。 我的 思路 先說方法 —— 遞歸, 由於題目說了

原创 [Leetcode]_45 Jump Game II

/** * Index: 45 * Title: Jump Game II * Author: ltree98 **/ 題意 給定一組非負整數; 從第一個索引開始向後走,數組索引對應的值代表最多可以走的步數; 求到達

原创 [Leetcode]_44 Wildcard Matching

/** * Index: 44 * Title: Wildcard Matching * Author: ltree98 **/ 題意 字符串匹配 Note: ‘?’ 可匹配任意一個字符(且必須匹配一個字符) ‘*