Recent questions tagged algorithms

0 votes
2 answers
2461
Which of the following describes growth of f(x)?1. Quadratic2.Linear3.Exponential4.Logarithm
0 votes
1 answer
2463
Consider the following function for(int n) { for(i = 1; i <= n; i = i*2) { for(j = 1; j <= i; j = j*2) printf(“GATE 2017”); } }
0 votes
1 answer
2464
Let A =[a1, a2, …, an] be a one-dimensional array of integers define a MEGA-PEAK in A to be an element ai belongs A such that ai >= aj for all aj with | j – i | <= 2....
0 votes
1 answer
2469
If f(n) = O(g(n)), is log(f(n)) = O(log(g(n))) ?I just learnt today that this relation does not hold, because log changes the behavior of the functions. But is it true? ...
0 votes
1 answer
2470
Does insertion sort always better than selection sort?
1 votes
1 answer
2471
Is 2 way merge behaves same as we do in merge sort?Dividing into groups of two from top to bottom or does it start from bottom to top by mergeing two elements at a time.?...
14 votes
4 answers
2472
9 votes
2 answers
2473
The number of ways , in which numbers 1,2,3,4,5 can be inserted into binary heap,such that resultant binary heap is max heap ?given ans :8
1 votes
1 answer
2474
0 votes
1 answer
2475
0 votes
0 answers
2476
0 votes
0 answers
2477
Assume that a merge sort algorithm in worst case takes30s for an input of size 64. Which of the following closely approximate maximum input size of a problem that can be ...
0 votes
1 answer
2478
Solve the following Recurrence Equation using back substitution methodT(n)= T(n-1)+log n​
1 votes
0 answers
2479
Solve the following Recurrence Equation using back substitution method T(n)= 2T(n/2)+log n​
0 votes
2 answers
2480
1 votes
1 answer
2481
0 votes
0 answers
2482
Consider the two functions (logn)k and nϵ, where k>1 and ϵ>0. The solution is (logn)k= O(nϵ). My doubt is that if we take ϵ as0.000000000000000000000000000000.........
1 votes
0 answers
2483
0 votes
2 answers
2484
what if i take f(x) = sinx,g(x)= cosx?these two cant be compared.sinx cant be written as O(cosx) and also cosx cant be written as O(sinx)then B becomes invalid.plz verify...
0 votes
1 answer
2485
$f(x) = n^{log (n)}$ $g(x) = nlog (n)$ $h(x) = 2^{n}$Arrange Them in Increasing Order of rate of growth
1 votes
1 answer
2486
2 votes
2 answers
2487
$T(N) = 2T\sqrt{N} + Log\sqrt{N}$what is the solution of recurrence relation
1 votes
2 answers
2488
for (int i = 1; i <=m; i += c){ -do something -}for (int i = 1; i <=n; i += c){ -do something - }What will the the tiem complexity of given code pseudococde?A. O (m...
0 votes
1 answer
2489
Solve given recurrence relation using Masters theorem:T(n) =T (n/2)+ n