討論串[問題] Google Interview Question (4)
共 13 篇文章
內容預覽:
Un, I didn't say O(log K).. See below discussion.. My bad, should say more detail.. In approach 2, it iterates with different left boundary.. For exam
(還有554個字)
內容預覽:
嗯, 剛剛想了一下.. 這個題目, 是 KMP 的變形.. 難的地方在於, 你怎麼想到正確的方向. (聽起來有點廢話, 哈哈..). 這裡我採用之前的定義.. For a sentance, we are given the occurance index.. Take above example,
(還有872個字)
內容預覽:
RockLee 想到的方法和我一開始想的是一樣的,. 我幫他加一點說明:. 首先,假設每一樣 list 都是排序過的. Pseudo code 大概會長的像這樣. Given lists = {list[1], list[2], ..., list[K]}. where list[i] = {p_i
(還有1452個字)
內容預覽:
我也還沒找到 O(n) 的作法,不過分享一下我到目前為止的想法。. 首先假設這 K 個 occurrences list 各自是排序過的. lists = {list_1, list_2, ..., list_K}. where list_i = {p_i1, p_i2, ...}. 不失一般性的假
(還有2015個字)
內容預覽:
我的ㄧ些習慣: (大家互相參考一下). 先確定演算法是對的, 作出 complexity,. 再用 Pseudo code 寫好. 確定結構 ( main program, and possible data structure). 再寫 Code.. 我不用 Java, 所以我只是很快的掃過你的
(還有151個字)