《计算模型与算法技术教学课件》8-Dynamic Programming.pptVIP

  • 5
  • 0
  • 约 37页
  • 2016-09-20 发布于浙江
  • 举报

《计算模型与算法技术教学课件》8-Dynamic Programming.ppt

* DP for Optimal BST Problem (cont.) After simplifications, we obtain the recurrence for C[i,j]: C[i,j] = min {C[i,k-1] + C[k+1,j]} + ∑ ps for 1 ≤ i ≤ j ≤ n C[i,i] = pi for 1 ≤ i ≤ j ≤ n Example: key A B C D probability 0.1 0.2 0.4 0.3 The tables below are filled diagonal by diagonal: the left one is filled using the recurrence C[i,j] = min {C[i,k-1] + C[k+1,j]} + ∑ ps , C[i,i] = pi ; the right one, for trees’ roots, records k’s values givin

文档评论(0)

1亿VIP精品文档

相关文档