Recent questions tagged time-complexity

0 votes
1 answer
601
Given a sequence of n real numbers a1,a2,a3...an then to find contiguous subsequence ai,ai+1,ai+2....aj. Such that it's sum is maximum. How much time the above problem wi...
0 votes
1 answer
602
0 votes
2 answers
603
Find the time complexity using Master's theorem : (Also mention if Master's theorem can't be applied why not?)T(n)=2T(n/2)+nlogn
0 votes
3 answers
604
Solve using Master's Theorem$T(n)=T(n/2)+$ 2n
1 votes
0 answers
606
What is the time complexity of the below code?for($k=n^{10};k \geq 5;k=k^{\frac{1}{7}},k=k^2$){ $k=k^5;$ $k=k-10$}My answer comes to be $O(log_{\frac{7}{10}}log_5(n^{...
1 votes
1 answer
607
Q.14 What is the time complexity of the following recursive function?int Dosomething (int n) {if(n≤2)return 1;elsereturn (Dosomething (floor(sqrt(n))) + n);(a) Ѳ(n 2 )...
2 votes
2 answers
608
0 votes
4 answers
609
0 votes
3 answers
611
4 votes
0 answers
614
for(int i=0; i < n; i++) { for(int j=0; j < (2*i); j+=(i/2)) { cout<<"Hello Geeks"; } }is it o(nlogn)??
4 votes
7 answers
615
0 votes
1 answer
616
You have to sort 1 GB of data with only 100 MB of available main memory. Which sorting technique will be most appropriate?1)QuickSort2)MergeSort3)HeapSort4)Selection Sort...
0 votes
2 answers
617
To construct binary search tree either from preorder or postorder what is the efficient time complexity ?can we construct unique BST along with post and preorder ?Then wh...
0 votes
2 answers
618
foo(int n) { for(int i=0 ; i<n ;i++) for(int j=i ; j<=i*i ;j++) if(j%i==0) { for(int k=0;k<j;k++) printf("hii"); } } How to proceed here for analyzing the time complexity...
0 votes
1 answer
619
15.4-1 is it right ???ans is 6 ??is there any other method to determine the lcs coz it requires time to compute till the whole traversal of matrix
0 votes
1 answer
623
all NP problems have the complexity exponential ???
0 votes
0 answers
624
To prove that the time complexity of equationT(n) = T(α n) + T((1 – α)n) + βnisΘ(n logn).
0 votes
2 answers
625
Hello anyone can help me to find big O for this algorithm please.... f=1;x=3;for (int i = 1; i <= n; i*=2) for (int j = 1; j <= i * i; j++) if (i % j == 0) ...
2 votes
1 answer
627
What is the time Complexity of 2T(n/2) + nlogn? Can we apply Master's Theorem?
0 votes
1 answer
628
what is the time complexity of the following program? int unknown(int n) { int i,j,k=0; for(i=n/2;i<=n;i++) for(j=2;j<=n;j=j*2) k=k+n/2; return (k); }Please explain brief...
3 votes
2 answers
629
The average no. of comparisons performed by the merge sort algorithm, in merging two sorted lists of length 2 is -a) 8/3b) 8/5c) 11/7d) 11/6
0 votes
1 answer
630