hej*_*dav 4 php algorithm complexity-theory big-o time-complexity
有人知道像这样的复杂度算法中的双星意味着什么O(N**3)吗?我在PHP的same_text()函数中发现了那个,并且不理解。
谢谢
这个双星是 PHP 中的求幂运算符(^ 运算符通常用于求幂)。
根据 PHP 手册,
$a ** $b ---- Exponentiation Operator
Result of raising $a to the $b'th power. Introduced in PHP 5.6.
Run Code Online (Sandbox Code Playgroud)
因此,这里的复杂度是 O(n^3),即 O of (n 的 3 次方) OR 立方复杂度。
| 归档时间: |
|
| 查看次数: |
1568 次 |
| 最近记录: |