|||
全同态加密中经常用到准多项式时间、对数多项式时间、亚指数时间等等。下面这张表详细列出了这些概念的意义及范例。表中poly(x) = xO(1),表示关于x的一个多项式。
Name | Complexity class | Running time (T(n)) | Examples of running times | Example algorithms |
---|---|---|---|---|
constant time | O(1) | 10 | Determining if an integer (represented in binary) is even or odd | |
inverse Ackermann time | O(α(n)) | Amortized time per operation using a disjoint set | ||
iterated logarithmic time | O(log* n) | Distributed coloring of cycles | ||
log-logarithmic | O(log log n) | Amortized time per operation using a bounded priority queue[2] | ||
logarithmic time | DLOGTIME | O(log n) | log n, log(n2) | Binary search |
polylogarithmic time | poly(log n) | (log n)2 | ||
fractional power | O(nc) where 0 < c < 1 | n1/2, n2/3 | Searching in a kd-tree | |
linear time | O(n) | n | Finding the smallest item in an unsorted array | |
"n log star n" time | O(n log* n) | Seidel's polygon triangulation algorithm. | ||
linearithmic time | O(n log n) | n log n, log n! | Fastest possible comparison sort | |
quadratic time | O(n2) | n2 | Bubble sort; Insertion sort; Direct convolution | |
cubic time | O(n3) | n3 | Naive multiplication of two n×n matrices. Calculatingpartial correlation. | |
polynomial time | P | 2O(log n) = poly(n) | n, n log n, n10 | Karmarkar's algorithm for linear programming; AKS primality test |
quasi-polynomial time | QP | 2poly(log n) | nlog log n, nlog n | Best-known O(log2 n)-approximation algorithm for the directed Steiner tree problem. |
sub-exponential time (first definition) | SUBEXP | O(2nε) for all ε > 0 | O(2log nlog log n) | Assuming complexity theoretic conjectures, BPP is contained in SUBEXP.[3] |
sub-exponential time (second definition) | 2o(n) | 2n1/3 | Best-known algorithm for integer factorization and graph isomorphism | |
exponential time | E | 2O(n) | 1.1n, 10n | Solving the traveling salesman problem using dynamic programming |
factorial time | O(n!) | n! | Solving the traveling salesman problem via brute-force search | |
exponential time | EXPTIME | 2poly(n) | 2n, 2n2 | |
double exponential time | 2-EXPTIME | 22poly(n) | 22n | Deciding the truth of a given statement in Presburger arithmetic |
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-12-23 00:52
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社