Recent questions tagged algorithms

0 votes
1 answer
1627
#include<stdio.h int main() { int sum =0; for(limit=1;limit<=n;limit*=2) { for(i=0;i<limit;i++) { for(j=0;j<n;j+=2) { sum+=j; } for(j=1;j<n;j*=2) { sum*=j; } } } }
0 votes
0 answers
1628
PS : This question is similar to GATE2004-82, but different, so plz donot close it with duplicate Note, and help in answering
2 votes
2 answers
1629
0 votes
1 answer
1630
Let $f (n) = Ο(n), g(n) = \Omega(n)$ and $h(n) = \theta(n)$. Then $g(n) + f(n).h(n)$ is ______How to solve such examples.Rules for math of asymptotic notations(mul,div,a...
1 votes
1 answer
1631
2 votes
1 answer
1632
Given f(n) = ω(n2).Which of the following can never hold?a. f(n) = O (n3)b. f(n) = Ω (n2)c. f(n) = θ (n2)d. f(n) = ω (n)
2 votes
1 answer
1633
3 votes
1 answer
1636
1 votes
0 answers
1638
is there is any short cut ? I am using prism algoritham ...its tak too much time
1 votes
1 answer
1641
2 votes
1 answer
1642
3 votes
1 answer
1646
Given A, an array of size n, comprised of an increasing sequence of numbers followed immediately by a decreasing one. What is worst case time complexity of optimal algori...
1 votes
3 answers
1648
1 votes
2 answers
1649
What is the worst case time complexity to find kth smallest element into an array of ‘n’ element?
1 votes
1 answer
1650
A sorting algorithm is stable if duplicate elements remain in the same relative position after sorting.What is the meaning of this statement