码迷,mamicode.com
首页 > 其他好文 > 详细

1.4.9

时间:2018-06-03 14:51:00      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:factor   规模   ble   run   ogr   answer   实验   log   hat   

question:

Give a formula to predict the running time of a program for a problem of size N when doubling experiments have shown that the doubling factor is 2^b and the running time for problems of size N0 is T.

answer:

//这个实验是每次问题规模增加一倍,即 * 2

所以由题知问题规模每增加一倍,时间增加2^b倍

T(N0)                                = T;

T(2 * N0)                           = 2^b T;

T(2^2 * N0) = 2^b * 2^b T = 2^(2b) T;

......

T(2^r N0)                          = 2^(r*b) T;

换元(令N = 2^r N0), 则 r = log2 (N/N0);

所以T(N) = 2^[(log2 (N/N0)) * b] T;

1.4.9

标签:factor   规模   ble   run   ogr   answer   实验   log   hat   

原文地址:https://www.cnblogs.com/w-j-c/p/9128555.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!