本文介绍了V8中Javascript方法的时间复杂度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道Javascript标准没有为数组 unshift 等方法指定所需的时间复杂性,但是在V8等特定Javascript引擎中是否存在时间复杂性的参考? / p>

I know that the Javascript standard does not specify required time complexities for methods like array unshift but is there a reference for time complexities in a specific Javascript engine like V8?

推荐答案

ECMA规范未指定你可能已经知道的那种复杂性,也不是那个引擎。每个JavaScript引擎都可以自由地实现自己的功能,只要它与标准兼容。

The ECMA specification does not specify a bounding complexity, as you already might know, and nor does that engine. Every JavaScript engine is free to implement its own functionality, as long as it is compatible with the Standard.

例如,V8不为其方法提供时间复杂度。

V8, for example, does not provide Time Complexities for its methods.

你当然可以查看源代码,构建我们脑海中使用的算法,理解它,分析它然后想出它的一个界限时间复杂性。

You could of course look at the source code, construct the algorithm used under the hood in our mind, understand it, analyse it and then come up with a bound for its Time Complexity.

这篇关于V8中Javascript方法的时间复杂度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 11:27