Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged time-complexity
0
votes
1
answer
571
Self Doubt
eswaraleti143
363
views
eswaraleti143
asked
Aug 11, 2018
Algorithms
time-complexity
+
–
0
votes
2
answers
572
masters theorem
Solution using back substitution method T(n) = 2T(n/2) + nlogn ? detailed solution please. ans is nlognlogn or n(logn)^2
Solution using back substitution methodT(n) = 2T(n/2) + nlogn ?detailed solution please.ans is nlognlogn or n(logn)^2
manvi_agarwal
1.7k
views
manvi_agarwal
asked
Aug 10, 2018
Algorithms
time-complexity
algorithms
master-theorem
asymptotic-notation
recurrence-relation
+
–
0
votes
3
answers
573
Time Complexity
What is the time complexity of the following? for(i=0; i < n *n ; i = i *i) print("*");
What is the time complexity of the following?for(i=0; i < n *n ; i = i *i)print("*");
smsubham
735
views
smsubham
asked
Aug 9, 2018
Algorithms
time-complexity
algorithms
asymptotic-notation
+
–
1
votes
2
answers
574
Time Complexity
HeadShot
1.5k
views
HeadShot
asked
Aug 8, 2018
Algorithms
algorithms
time-complexity
test-series
+
–
0
votes
1
answer
575
Binary search
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)
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)
Sabir Khan
1.1k
views
Sabir Khan
asked
Aug 8, 2018
Algorithms
algorithms
sorting
binary-search
time-complexity
+
–
0
votes
1
answer
576
Ace Algorithms
If k is a positive constant, then the following divide and conquer recurrence evaluates to? T(n) = k ; n=1 T(n) = 3 T (n/2) + kn ;n>1 a)T(n)= 3kn2-kn b)T(n)=3kn log23 - 2kn c)T(n)=3knlog23 - kn d)T(n)=3kn2-2knlog23
If k is a positive constant, then the following divide and conquer recurrence evaluates to?T(n) = k ; n=1T(n) = 3 T (n/2) + kn ;n>1a)T(n)= 3kn2-knb)T(n)=3kn log23 - 2knc...
Sambhrant Maurya
390
views
Sambhrant Maurya
asked
Aug 7, 2018
Algorithms
recurrence-relation
divide-and-conquer
time-complexity
+
–
0
votes
1
answer
577
Made Easy Algorithms
How to calculate the time complexity for finding repeated elements in an array of n elements using linear search and binary search?
How to calculate the time complexity for finding repeated elements in an array of n elements using linear search and binary search?
Sambhrant Maurya
713
views
Sambhrant Maurya
asked
Aug 6, 2018
Algorithms
algorithms
time-complexity
binary-search
+
–
0
votes
1
answer
578
Made Easy algorithms
Given an array of n elements, two elements in the array a[i] and a[j] are said to be inverse only if a[i]>a[j] && i<j. What is the time complexity required to find the number of inverses in the given array using merge sort? a) O(n) b) O(n2) c) O(nlogn) d) O(logn)
Given an array of n elements, two elements in the array a[i] and a[j] are said to be inverse only if a[i]>a[j] && i<j. What is the time complexity required to find the nu...
Sambhrant Maurya
327
views
Sambhrant Maurya
asked
Aug 6, 2018
Algorithms
algorithms
merge-sort
time-complexity
+
–
0
votes
1
answer
579
Masters Theorem
How can we apply Masters theorem to these equations : T(n) = 16*T(n/4) + n! and T(n) = 4*T(n/2) + cn Please explain the process.
How can we apply Masters theorem to these equations : T(n) = 16*T(n/4) + n!and T(n) = 4*T(n/2) + cnPlease explain the process.
Rahul Ranjan 1
1.6k
views
Rahul Ranjan 1
asked
Aug 6, 2018
Algorithms
master-theorem
time-complexity
algorithms
asymptotic-notation
recurrence-relation
+
–
0
votes
0
answers
580
Time complexity
What is the time complexity of the following code snippet? function(n) { for i=1 to n { if(n<=10000) { for j=1 to n { for k=1 to n { val = val + 1; } } } else { for j=1 to n val = val + 1 } } } I am getting answer as O(n$^{2}$). But answer is given as O(1). Explain briefly.
What is the time complexity of the following code snippet? function(n) { for i=1 to n { if(n<=10000) { ...
Siddharth Bhardawaj
564
views
Siddharth Bhardawaj
asked
Aug 5, 2018
Algorithms
time-complexity
+
–
0
votes
1
answer
581
Time complexity
What is the time complexity of the following code? int j = 0; for(i=0;i<n;i++) { for(i=0;i<2n;i++) { while(j<n) { j++; } } } a) O(n$^{4}$) b) O(n$^{3}$) c) O(n$^{2}$) d) O(n) I am getting option O(n$^{2}$) and answer is given O(n) Explain briefly.
What is the time complexity of the following code? int j = 0; for(i=0;i<n;i++) { for(i=0;i<2n;i++) { while(j<n) { j++; } } }a) O(n$^{4}$)b) O(n$^{3}$)c) O(n$^{2}$)d)...
Siddharth Bhardawaj
1.9k
views
Siddharth Bhardawaj
asked
Aug 5, 2018
Algorithms
time-complexity
+
–
0
votes
1
answer
582
Ace algorithms
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; }
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;}
Sambhrant Maurya
776
views
Sambhrant Maurya
asked
Aug 3, 2018
Algorithms
time-complexity
ace-test-series
+
–
0
votes
2
answers
583
self doubt ugcnet
doubt on complexity of bellman ford how it can be O(V2E)
doubt on complexity of bellman ford how it can be O(V2E)
eyeamgj
1.3k
views
eyeamgj
asked
Aug 3, 2018
Algorithms
time-complexity
bellman-ford
graph-algorithm
match-the-following
+
–
1
votes
1
answer
584
Made Easy Algorithms
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?
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?
Sambhrant Maurya
532
views
Sambhrant Maurya
asked
Aug 2, 2018
Algorithms
algorithms
time-complexity
made-easy-booklet
+
–
1
votes
2
answers
585
Sorting
Could a binary search tree be built using o(n lg n) comparisons in the comparison model? Explain why or why not.
Could a binary search tree be built using o(n lg n) comparisons in the comparisonmodel? Explain why or why not.
Ravi Dubey
829
views
Ravi Dubey
asked
Aug 2, 2018
Algorithms
sorting
algorithms
time-complexity
test-series
+
–
0
votes
2
answers
586
Made Easy Algorithms
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"); } }
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");}}
Sambhrant Maurya
579
views
Sambhrant Maurya
asked
Aug 1, 2018
Algorithms
time-complexity
made-easy-booklet
+
–
3
votes
3
answers
587
CORMEN
What is the asymptotic performance of TREE-INSERT when used to insert n items with identical keys into an initially empty binary search tree?
What is the asymptotic performance of TREE-INSERT when used to insert nitems with identical keys into an initially empty binary search tree?
Rishav Kumar Singh
661
views
Rishav Kumar Singh
asked
Jul 31, 2018
DS
data-structures
binary-search-tree
time-complexity
+
–
0
votes
2
answers
588
time complexity
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?
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?
Bhunesh_Singh
278
views
Bhunesh_Singh
asked
Jul 31, 2018
Algorithms
time-complexity
algorithms
+
–
1
votes
1
answer
589
Ace volume-2 divide and conquer method
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.
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.
meethunjadhav
406
views
meethunjadhav
asked
Jul 30, 2018
Algorithms
time-complexity
merge-sort
sorting
divide-and-conquer
+
–
1
votes
1
answer
590
MIT_algorithms
I don't understand How?
I don't understand How?
Rishav Kumar Singh
485
views
Rishav Kumar Singh
asked
Jul 30, 2018
Algorithms
time-complexity
algorithms
mit-quiz
+
–
2
votes
3
answers
591
sorting
When the recurrence relation for both are same , why they both getting different result? Q1. In a modified merge sort, the input array is splitted at a position one-third of the length(N) of the array. What is the worst case time complexity of this merge sort? ANSWER: recurrence ... is If for first case it is N(log3/2N) then for second case also it should be N(log4/3N) BUT its not. WHY?
When the recurrence relation for both are same , why they both getting different result?Q1. In a modified merge sort, the input array is splitted at a position one-third ...
Rishav Kumar Singh
1.4k
views
Rishav Kumar Singh
asked
Jul 29, 2018
Algorithms
algorithms
sorting
time-complexity
+
–
1
votes
0
answers
592
Algorithms
Solve the recurrence relation $T(n) = T(\sqrt{n}) + n$
Solve the recurrence relation $T(n) = T(\sqrt{n}) + n$
gauravkc
657
views
gauravkc
asked
Jul 27, 2018
Algorithms
algorithms
asymptotic-notation
time-complexity
+
–
0
votes
1
answer
593
Time complexity
Which one is larger $O(√n)$ or $O(log n)$ ?
Which one is larger $O(√n)$ or $O(log n)$ ?
Vishnathan
299
views
Vishnathan
asked
Jul 27, 2018
Algorithms
asymptotic-notation
time-complexity
+
–
0
votes
1
answer
594
Recurrence Relation
Solve the following recurrence relation :- N(h)=N(h−1)+N(h−2)+1
Solve the following recurrence relation :-N(h)=N(h−1)+N(h−2)+1
bts
504
views
bts
asked
Jul 27, 2018
Programming in C
recurrence-relation
time-complexity
algorithms
+
–
1
votes
1
answer
595
GeeksForGeeks analysis-of-algorithms Question 15
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?
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?
Rishav Kumar Singh
887
views
Rishav Kumar Singh
asked
Jul 25, 2018
Algorithms
time-complexity
merge-sort
+
–
1
votes
2
answers
596
Self Doubt
<!--StartFragment --> void fun(int n, int arr[]) { int i = 0, j = 0; for(; i < n; ++i) while(j < n && arr[i] < arr[j]) j++; } In this question the inner loop runs n times at most because j is not ... wont the outer loop also run n times (incrementing and checking conditions in while) and making the total time complexity to be O(n2)?? <!--EndFragment -->
<! StartFragment >void fun(int n, int arr[]){ int i = 0, j = 0; for(; i < n; ++i) while(j < n && arr[i] < arr[j]) j++;} In this question the inne...
harishrajora
1.6k
views
harishrajora
asked
Jul 23, 2018
Algorithms
algorithms
time-complexity
+
–
0
votes
2
answers
597
random gate website
// 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 ?
// 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 ?
saurabh12345
246
views
saurabh12345
asked
Jul 23, 2018
Algorithms
time-complexity
+
–
0
votes
1
answer
598
sorting
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 these explain briefly.
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...
Siddharth Bhardawaj
1.6k
views
Siddharth Bhardawaj
asked
Jul 21, 2018
Algorithms
time-complexity
sorting
+
–
0
votes
0
answers
599
Doubt
Can we solve it by master Theorem T(n)=T(n/3)+T(n/4)+6n
Can we solve it by master TheoremT(n)=T(n/3)+T(n/4)+6n
bhavnakumrawat5
400
views
bhavnakumrawat5
asked
Jul 18, 2018
Algorithms
time-complexity
+
–
0
votes
2
answers
600
Time complexity
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 these .
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...
Tripti bhardwaj
393
views
Tripti bhardwaj
asked
Jul 18, 2018
Algorithms
sorting
time-complexity
+
–
Page:
« prev
1
...
15
16
17
18
19
20
21
22
23
24
25
...
53
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register