сложность

How to determine the complexity of the sorting algorithm?

There is a sorting algorithm: def search(a): if len(a) < 2: return a pivot = a[0] left = [int(i) for i ... t] return search(left) + [pivot] + search(right) I want to determine its complexity, can you tell me how to do it?

Algorithm execution time?

There is a dynamic programming algorithm where you need to find the largest decreasing subsequence. The algorithm in this cas ... to n, then it is clear that the execution time is n2 (n is the square), but in the above case, it turns out that? n log(n) ?

P-class of problems and NP-class of problems

Please explain in as much detail as possible what P problems, NP (complete , complex ..) problems are . And then after reading it, I did not understand. Thank you in advance

What is the complexity of my implementation of the 'Eratosthenes Sieve' algorithm, how to improve it?

Help us understand the complexity of the algorithm. I tried to implement the 'Sieve of Eratosthenes'. P.S. As far as I unders ... } for(var i = 2; i < number; i++) { if(tempArray[i] != 0) finalArray.push(i); } return finalArray; }

Compare each array element with each without nested loop

Each element of the array must be compared with each. How can I get rid of the nested loop in my case, because it greatly inc ... { for(int j = 0; j < n; j++) { if(towns[i] - towns[j] == d) count++; } }

Optimization of operations for a binary indexed tree (Fenwick tree)

I am doing optimization in one project that is very out of line with the performance requirements. Here, Fenwick trees are wi ... any imperative language. If my reasoning about complexity is wrong, then I would like to know what exactly I am wrong about.

Why is log N used to calculate the complexity of algorithms instead of lb N?

In all sources, the complexity of the algorithms is denoted as log N (without specifying the basis). In this case, we mean th ... be completely different - this is clearly visible on the graph. So what kind of logarithm is important to use. Or am I wrong?

Translation of the English term "linearithmic" O (N * log N) into Russian

Linearithmic time complexity - linear-logarithmic complexity, O(N * log N) Are there any "short" translations of the word li ... ное [9] линлогное [9] линарифмическое [15] линейнологарифмическое [22] More options?