今天我們來解一道 LeetCode 的經典題目:Longest Substring Without Repeating Characters。這道題目考驗字串處...
今天來解YKL03(UVA10812):Beat the Spread!
Beat the Spread!
給一個s(sum)和d(difference)要o...
572. Subtree of Another Tree
tags: Easy、Tree
Given the roots of two binary tree...
What is Buffer Overflow?
當程式對一個固定大小的緩衝區進行資料寫入時,如果超過了該緩衝區的容量,那麼多出來的資料會覆蓋相鄰的記憶體區域。...
解題程式碼
var distanceK = function (root, target, k) {
const graphMap = new Map();...
二元搜尋法(Binary Search),又稱作折半搜尋法、對數搜尋法,適用於有序陣列中搜尋目標元素的演算法,此演算法每進行一次比較將使搜尋範圍縮小一半。搜尋的...