简体   繁体   English

这个执行时间的合适术语是什么?

[英]What's the proper term for this execution time?

If you have some computation that you have to do for N elements against X elements. 如果您需要对N元素对X元素进行一些计算。

For example if you have 10 points and 1M points in space where for each of these 1M points, you have to find the distance to the closest of the 10 points, and you require 10M operations, what kind of execution would that be called? 例如,如果您在空间中有10个点和1M个点,那么对于这1M个点中的每个点,您都必须找到最接近的10个点的距离,并且您需要进行10M个操作,那么该执行哪种方式?

If I can do this in 1M operations, then I can say the whole operation executes in linear time , right? 如果我可以在1M次操作中做到这一点,那么我可以说整个操作都linear time执行,对吗? Since it scales linearly with the number of points. 由于它与点数成线性比例关系。 But if it's N * X , then would it be polynomial time? 但是,如果它是N * X ,那么它将是多项式时间吗?

Your input length is L=N+X, and your computation time is T=N*X. 输入长度为L = N + X,计算时间为T = N * X。

T will never exceed (L/2)^2 = L^2 / 4, which is definitely polynomial. T永远不会超过(L / 2)^ 2 = L ^ 2/4,这绝对是多项式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM