gpt4 book ai didi

algorithm - 二次算法的时间复杂度

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:32:30 25 4
gpt4 key购买 nike

<分区>

为了我的编程和算法设计考试,我必须熟悉时间复杂度和大 O 表示法。我了解大部分内容,但后来我遇到了这个问题,我的解决方案似乎相当简单;但我不明白哪些步骤是必要的。有人可以澄清所采取的步骤吗?

练习:

A quadratic algorithm with processing time T(n) = cn^2 spends T(N) seconds for processing N data items. How much time will be spent for processing n = 3000 data items, assuming that N = 100 and T (N) = 1 ms?

给出的解决方案:

The constant factor c = T(N)/(N^2), therefore T(n) = T(N) * (n^2)/(N^2) = n^2/10000 and T (3000) = 900 ms

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com