Linked Questions
294 questions linked to/from Is there a system behind the magic of algorithm analysis?
0
votes
1
answer
48
views
Are there techniques to know how many times loops like these will run? [duplicate]
How do you evaluate how many times some loops will run, when you start to complicate the boundaries conditions? For example, take this function:
...
1
vote
0
answers
60
views
What is the nature of this algorithm and How to find its complexity ? [duplicate]
This algorithm computes the number of ways one can make change for n cents assuming one can use six types of coins. Singles, half dollars, quarters, dimes, nickels and pennies. In the following ...
0
votes
0
answers
57
views
Behavior of an algorithm with inner loop step by 2 and outer loop decrements inner loop times [duplicate]
I designed an algorithm like this but I do not know how to perform its analysis to determine how it runs $($$O(n)$, $O(n^2)$, $O(log(n)$, $etc$$)$
...
-2
votes
1
answer
44
views
The complexity of the algorithm with loops [duplicate]
I have algorithm that contains next loops:
for (int i = 0; i < size; ++i) {
for (int j = i + 1; j < size; ++j) {
//Do stuff
}
}
I found ...
2
votes
1
answer
69
views
Master method recurrence question [duplicate]
This is specifically a question pertaining to solving reccurences via the Master Theorem/Method, particularly for a specified $f(n)$ (as denoted below).
For a recurrence of $$T(n) = a T(\frac{n}{b}) +...
-1
votes
1
answer
41
views
Little bit confusing to compute time complexity of nested loop [duplicate]
1 for(i=1; i<=n; i++){
2 for(j=1; j<=n; j*=2){
3 a[i][j]=b[i][j-1]+1;
4 }
5 }
line 1 : n+1 times
lnie 2 : n/2+1 times
line 3 : constant time c
...
0
votes
1
answer
51
views
What will be big O complexity for this loop? [duplicate]
I am not able to understand time complexity of this for loop.
While outer loop is O(n) the inner loop jumps certain calculation. How to find the complexity?
...
0
votes
0
answers
50
views
How to get time complexity of n queen puzzle algorithm(Using Backtracking)? [duplicate]
I have the following algorithm
...
1
vote
1
answer
38
views
Theta bound of the following function [duplicate]
Suppose the function $f(n)$ is defined as the number of $\ast$ printed in the following code
...
1
vote
0
answers
48
views
0
votes
0
answers
48
views
Complexity of this function [duplicate]
I have this function
...
1
vote
0
answers
48
views
Deterministic Selection Median of Medians [duplicate]
As I understand, a quick-select algorithm could use median of medians to find best suited pivot to yield the i-th item in the array, say A.
I have referred to Median of Medians algorithm and steps ...
0
votes
0
answers
44
views
Recursive algorithm. Complexity [duplicate]
I need your help with time complexity.
I have this recursive function:
$$
F(n) = \left\{
\begin{array}{l l}
F(n-2) + 10 F\big(\frac{n}{6}\big)^2 + 6 F\big(\frac{n}{7}\big) + \frac{n^4}{5} & \...
0
votes
0
answers
43
views
Algorithm complexity of this program is O(n) or O(n^3)? [duplicate]
I am very much confuse that why complexity of this program is O(n)?
...
0
votes
0
answers
42
views
what will be the time complexity of below recursive algorithm [duplicate]
Please help me find the time-complexity of below recursive algo. I have guessed for first two return statements.Please correct me if I am wrong. But I can't find time-complexity of third return ...