TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Some functions may have negative complexity and I’m worried for my crypto

3 点作者 LightMachine将近 7 年前

1 comment

gus_massa将近 7 年前
Is this just a very smart optimizer that can reduce<p><pre><code> tot=x+x+x+x+x+x+x+x+x+x+x+x+x+x+x </code></pre> to<p><pre><code> x2=x+x x4=x2+x2 x8=x4+x4 tot=x+x2+x4+x8 </code></pre> or I am missing something?<p>Note that the first code is O(N=15) and the second one is O(log(N)=4).