Lowest Common Ancestor of a Binary Search Tree
thoughts
BST 性質:左子樹 < root &l...
Find Peak Element (LeetCode 162, Binary Search)
thoughts
峰值定義:nums[i] > nums...
Remove N-th Node from End of List - LeetCode 19
question
刪除鏈表中倒數第 n 個節點,回傳新的頭節點...
Remove Duplicates from Sorted Array這題的核心是要求在原地(in-place)移除已排序陣列中的重複元素,並返回不重複元素...
Reverse Nodes in k-Group
這是關於反轉鏈結串列中k個節點的演算法問題。它要求將給定的單項鏈結串列,以每k個節點為一組進行反轉。如果...
Swap Nodes in Pairs
這是一道鏈結串列問題,要求將鏈結串列中每兩個相鄰的節點進行交換,並返回新的串列頭。重要的是,不能改變節點內的值(v...