Recent questions tagged time-complexity

0 votes
1 answer
571
0 votes
2 answers
572
0 votes
3 answers
573
What is the time complexity of the following?for(i=0; i < n *n ; i = i *i)print("*");
1 votes
2 answers
574
0 votes
1 answer
575
The minimum number of comparisons required to determine if an integer appears more than n/2 times in a sorted array of n integers is(A) (n)(B) (logn)(C) (log*n)(D) (1)
0 votes
1 answer
576
0 votes
1 answer
577
How to calculate the time complexity for finding repeated elements in an array of n elements using linear search and binary search?
0 votes
1 answer
579
0 votes
1 answer
581
0 votes
1 answer
582
What is the time complexity?int i,j,k,x=0;for(i=1;i<=n;i++)for(j=1;j<=i*i;j++){if (j mod i ==0)for(k=1;k<=j;k++)x=x+10;}
0 votes
2 answers
583
1 votes
1 answer
584
for(i=n,j=1;i>=1;i=i/2,j=j+i)What is the value of j by the end of the loop?a) O(log n) b)O(n) c) O(n2) d)O(n log n) How do I calculate this?
1 votes
2 answers
585
Could a binary search tree be built using o(n lg n) comparisons in the comparisonmodel? Explain why or why not.
0 votes
2 answers
586
What is the time complexity for the code below?for(i=1; i<=n;i++){for(j=1;j<=n;j++){for(k=j+1;k<=n;k++)printf("Hi");}}
3 votes
3 answers
587
What is the asymptotic performance of TREE-INSERT when used to insert nitems with identical keys into an initially empty binary search tree?
0 votes
2 answers
588
main() { int i,count; for (i=1; i<=n; i++) { for(i=1; i<=(n*n); i++) { for(i=1; i<=(n*n*n); i++) { count++; } } } }What will be the time complexity of the given program?
1 votes
1 answer
589
suppose merge sort takes 2 sec to sort a set of 64 keys then how much time will take to sort a set of 512 keys?here, ans is 24 sec how it is plz explain me.
1 votes
1 answer
590
1 votes
0 answers
592
Solve the recurrence relation $T(n) = T(\sqrt{n}) + n$
0 votes
1 answer
593
Which one is larger $O(√n)$ or $O(log n)$ ?
0 votes
1 answer
594
Solve the following recurrence relation :-N(h)=N(h−1)+N(h−2)+1
1 votes
1 answer
595
In a modified merge sort, the input array is split at a position one-third of the length(N) of the array. What is the worst case time complexity of this merge sort?
0 votes
2 answers
597
// Here c is a constant for (int i = 1; i <= c; i++) { // some O(1) expressions } here complexity is o(1) but how can any one please tell me ?
0 votes
1 answer
598
Given 2-sorted arrays each of n-elements and distinct. How much time it will take to find middle element of the union sorted array?a) O(1)b) O(logn)c) O(n)d) None of thes...
0 votes
0 answers
599
Can we solve it by master TheoremT(n)=T(n/3)+T(n/4)+6n
0 votes
2 answers
600
Given two sorted arrays each of n elements and distinct .how much time it will take to find the middle element of the union sorted array ?1.O(1)2.O(logn)3.O(n)4.none of t...