January 2018
Intermediate to advanced
332 pages
7h 36m
English
Polynomial time complexity is the running time complexity of algorithms, which runs to the order of nk. Quadratic time algorithms are certain types of polynomial time algorithms where k = 2. A very simple example of such an algorithm would be as follows:
for (int i = 0; i <n; i += c) {
for (int j = 0; j < n; j += c) { for (int k = 0; k < n; k += c) {
// some O(1) expressions
} }}
As you can see, this example is just an extension of the example in the quadratic time section. The worst case complexity of this case is O(n3).
Read now
Unlock full access