算法复杂度-双星意味着什么

hej*_*dav 4 php algorithm complexity-theory big-o time-complexity

有人知道像这样的复杂度算法中的双星意味着什么O(N**3)吗?我在PHP的same_text()函数中发现了那个,并且不理解。

谢谢

aks*_*pal 6

**表示力量。因此,n ** 3表示n ^ 3。复杂度约为n ^ 3或O(n ^ 3)


Am_*_*ful 5

这个双星是 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 立方复杂度。