Lowest Common Ancestor of a Binary Search Tree
thoughts
BST 性質:左子樹 < root &l...
Linked List Cycle (LeetCode 141)
thoughts
使用 Floyd’s Cycle Detection (快慢指針):
sl...
Middle of the Linked List (Linked List) 876
question
給定一個單向鏈結串列,找到其中間節點並回傳。
如果有...
當 AI 的能力越來越強大,倫理問題也隨之而來。最明顯的例子是 偏見與歧視,AI 模型是由大量資料訓練而成,如果資料本身帶有偏見,例如性別、種族或社會階層的不平...
「那 insert 和 insertRec 的差異呢?」
「insertRec 是 insertRecursive 的縮寫,意思是『用遞迴來插入』。」
「遞迴?...
Reorder List (LeetCode 143)
thoughts
將鏈表重新排序:L0 → Ln → L1 → Ln-1 → …
步驟:
找到中點...