Recent questions tagged algorithms

427
views
2 answers
1 votes
Is ln(n!)=theta(n ln(n))?
307
views
1 answers
0 votes
If big oh is possible for an algorithm but big Omega is not,then is it small o?
364
views
0 answers
0 votes
Time Complexity in C will be O(n) right? and big omega (n) is also big omega (n^2), then why is c incorrect?
325
views
0 answers
0 votes
Hello, i have a algorithm and i want to prove it with induction how can i do that ?Also i want to worst case run time analyze but i am not very good please help me please.Thank you so much!
1.1k
views
1 answers
1 votes
844
views
2 answers
1 votes
how do i apply master theorem to this? T(n)=2T(n/2)−n^3n
817
views
1 answers
1 votes
how do i apply master theorem to this? 𝑇(𝑛)=16𝑇(𝑛/4)+5𝑛^3
1.2k
views
1 answers
0 votes
How to solve this recurrence relationT(n)= T(0.09n) + T(0.91n) + cnwhere c is constant and T(1)=1options are-
237
views
0 answers
0 votes
Consider the following statements of approximation algorithm :Statement $\text{I}$: Vertex-cover is a polynomial time $2$-approximation algorithm.Statement $\text{II}$: ... $\text{I}$ and Statement $\text{II}$ false
321
views
1 answers
0 votes
Consider the following algorithms and their running times :AlgorithmsComplexities(A) Breadth First Search(I) $\theta(v+E)$(B) Rabin-Karp Algorithm(II) $O(v+E)$ ...
435
views
0 answers
0 votes
How option B is incorrect.
541
views
1 answers
0 votes
What is the logic applied here.
381
views
1 answers
0 votes
Focus on the word constraint , I am little confused (in meaning of the word)here. What should be the answer 2 or 16.
571
views
1 answers
0 votes
417
views
1 answers
0 votes
426
views
1 answers
0 votes
how O($n^{2}$) in the last.(in the given solution).
304
views
0 answers
0 votes
Is it really coping operation will take O(n).Does copy is done character by character.means simple code like (in c++) for(int i=0;i<n;i++){s=s;}will take O($n^{2}$)
389
views
0 answers
0 votes
I am not getting the question.(Please explain me the question first).
294
views
0 answers
0 votes
A long distance runner wants to carry only a single water bottle along the route and she can run k miles on one bottle of water. Before the race, ... of waterOutput: Sequence S of watering stops for the runner minimizing number of stops
646
views
2 answers
1 votes
How is the max possible value of n is 12? We will have to store T(0) and T(1) in stack too, so we can call f(11) at max which will require T(10) and T(9 ... in stack. But if we call f(12) we wont be able to store it as overflow will occur.
785
views
1 answers
0 votes
Why magic square problem algorithm works ? Problem :- https://en.wikipedia.org/wiki/Magic_squareAny proof for the algorithm of problem why the algorithm works ?
1.5k
views
3 answers
3 votes
what will be time complexity of this program?void function(int n){ int count = 0; for (int i=0; i<n; i++) { for (int j=1; j< i*i; j++) { ... ++) printf("*"); } } }}
811
views
3 answers
0 votes
What is the time & space complexity of this algorithm?Main(){ for(i=n; i>10; i=i^1/4) { for(j=201; j<n^3; j=j+400) ... =k^61; } } }}
655
views
0 answers
0 votes
T(n) = 3T(n-1) -4T(n-2) + 2T(n-3)If n = 0 then T(n) = 1 if n= 1 or 2 then T(n) = 0What is the generalized solution?
523
views
2 answers
0 votes
Rahul knows the implementation of merge sort. One day, his teacher asked him to find numbers of inversion in an array. An inversion can be defined in an array as ... complexity to find inversions in an updated array?O(n)O(nlogn)O(n^2)None