5.2 「THE MASTER METHOD」Motivation - Part2

quiz is the second one. Namely, the only thing that changes with respect to the

first recurrence, is that the number of recursive calls drops from four down to

three. A coupla quick comments. So, first of all, I'm being a little bit sloppy when

I say there's three recursive calls, each on digits, each on numbers with n over two

digits. When you take the sums a plus b and c plus d, those might well have n over

two plus one digits. Amongst friends, let's ignore that, let's just call it n

over two digits and each did recursive calls. As usual, the extra plus one is not

gonna matter in the final analysis. Secondly, I'm ignoring exactly. What the

constant factor is in the linear work done outside of the recursive calls. Indeed,

it's a little bit bigger in Gaus's algorithm than it is in the naive

algorithm with four recursive calls. But it's only a constant factor and that's

gonna be supressed in the big O notation. So let's look at this occurance and

compare it to two other recurrences, one bigger, one smaller. So first of all, as

we noted, it differs from the previous recurrence of the naive recursive

algorithm in having one fewer recursive calls. So we have no idea what the running

time is of either of these two recursive algorithms but we should be confident that

this one's. Certainly can only be better, that's for sure. Another point of contrast

is Merge Short. So think about what the recurrence would look like for the Merge

Short algorithm. It would be almost identical to this one, except instead of a

three, we'd have a two, right? Merge Short makes two recursive calls, each on an

array of half the size. And outside of the recursive calls, it does linear work,

mainly for the merged subroutine. We know the running time of Merge Short. It's N

log n. So this algorithm, Gaus's algorithm is gonna be worse, but we don't

know by how much. So while we have a couple clues about what the running time

of this algorithm might be more or less than, honestly, we have no idea what the

running time of Gaus's recursive algorithm for integer multiplication

really is. It is not obvious, we currently have no intuition for it. We don't know

what the solution to this recurrence is. But it will be one super special case of

the general master method, which we'll tackle next.

?著作權歸作者所有,轉載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末汹押,一起剝皮案震驚了整個濱河市撞鹉,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌空闲,老刑警劉巖,帶你破解...
    沈念sama閱讀 218,546評論 6 507
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件毡们,死亡現(xiàn)場離奇詭異婉支,居然都是意外死亡稽穆,警方通過查閱死者的電腦和手機,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,224評論 3 395
  • 文/潘曉璐 我一進店門米丘,熙熙樓的掌柜王于貴愁眉苦臉地迎上來剑令,“玉大人,你說我怎么就攤上這事拄查∮踅颍” “怎么了?”我有些...
    開封第一講書人閱讀 164,911評論 0 354
  • 文/不壞的土叔 我叫張陵,是天一觀的道長碍脏。 經(jīng)常有香客問我梭依,道長,這世上最難降的妖魔是什么典尾? 我笑而不...
    開封第一講書人閱讀 58,737評論 1 294
  • 正文 為了忘掉前任役拴,我火速辦了婚禮,結果婚禮上钾埂,老公的妹妹穿的比我還像新娘河闰。我一直安慰自己,他們只是感情好褥紫,可當我...
    茶點故事閱讀 67,753評論 6 392
  • 文/花漫 我一把揭開白布姜性。 她就那樣靜靜地躺著,像睡著了一般故源。 火紅的嫁衣襯著肌膚如雪污抬。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,598評論 1 305
  • 那天绳军,我揣著相機與錄音印机,去河邊找鬼。 笑死门驾,一個胖子當著我的面吹牛射赛,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播奶是,決...
    沈念sama閱讀 40,338評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼楣责,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了聂沙?” 一聲冷哼從身側響起秆麸,我...
    開封第一講書人閱讀 39,249評論 0 276
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎及汉,沒想到半個月后沮趣,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,696評論 1 314
  • 正文 獨居荒郊野嶺守林人離奇死亡坷随,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,888評論 3 336
  • 正文 我和宋清朗相戀三年房铭,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片温眉。...
    茶點故事閱讀 40,013評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡缸匪,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出类溢,到底是詐尸還是另有隱情凌蔬,我是刑警寧澤,帶...
    沈念sama閱讀 35,731評論 5 346
  • 正文 年R本政府宣布,位于F島的核電站龟梦,受9級特大地震影響隐锭,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜计贰,卻給世界環(huán)境...
    茶點故事閱讀 41,348評論 3 330
  • 文/蒙蒙 一钦睡、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧躁倒,春花似錦荞怒、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,929評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至象迎,卻和暖如春荧嵌,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背砾淌。 一陣腳步聲響...
    開封第一講書人閱讀 33,048評論 1 270
  • 我被黑心中介騙來泰國打工啦撮, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人汪厨。 一個月前我還...
    沈念sama閱讀 48,203評論 3 370
  • 正文 我出身青樓赃春,卻偏偏與公主長得像,于是被迫代替她去往敵國和親劫乱。 傳聞我的和親對象是個殘疾皇子织中,可洞房花燭夜當晚...
    茶點故事閱讀 44,960評論 2 355