Divide and Conquer Michael Tsai 2011225 14 Recurrences Slides: 28 Download presentation Divide and Conquer Michael Tsai 2011/2/25 14 Recurrences 20 股市大亨: 嘗試三 Day 1 2 3 Price 100 113 110 13 4 6 7 8 85 102 86 63 -3 -16 -23 -3 -25 5 20 9 10 13 14 15 16 17 81 101 94 106 101 79 94 90 97 18 -7 -5 -22 15 -4 7 20 11 12 12 24 股市大亨: 嘗試三 Base Case: n=1的時候 maximum subarray? 就是它自己. 26 股市大亨 之 酥多扣的(pseudo-code) Base Case Recursive Case Divide Combine 27 執行時間分析 n個數字找max subarray Base case: n=1的時候直接return. Recursive case: Divide: 2個 n/2個數字找max subarray Combine: 1. 確認n>1, 計算中間點位置等等 2. 尋找通過mid的max subarray 3. 比較三個max subarray的大小決定最後結果 Divide and conquer advantages and disadvantagesDivide and conquer and greedy methodVoronoi diagramDelaunay triangulation divide and conquer algorithmCounting inversions divide and conquerMetoda divide et impera c++ probleme rezolvateDynamic programming bottom upDynamic programming vs divide and conquerDivide and conquerSkyline problem divide and conquerSkyline problem divide and conquerEuclidean algorithm divide and conquerDivide and conquer pseudocodeSubtract and conquerContoh algoritma divide and conquerDefective chessboard problem divide and conquerDivide and conquer algorithmDivide and conquer algoritmaKnapsack problem divide and conquerWander her womb henPowering a number divide and conquerIs shell sort divide and conquerLet's divide and conquerDivide and conquer complexityDivide ut imperesNnn sortTuliskan algoritma divide and conquerDivide & conquerDivide and conquer