Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged time-complexity
5
votes
2
answers
841
Time Complexity
Consider the following function Void func(int n){ Int k=n; Int i=0; for(;i<n;i++){ while(k>1){ k>>=1; } } What is the worst case time complexity of the function?
Consider the following functionVoid func(int n){Int k=n;Int i=0;for(;i<n;i++){while(k>1){k>>=1;}}What is the worst case time complexity of the function?
shaurya vardhan
1.7k
views
shaurya vardhan
asked
Nov 2, 2017
Algorithms
time-complexity
algorithms
asymptotic-notation
recursion
programming-in-c
+
–
4
votes
1
answer
842
Time Complexity
Consider the following code….. Search(int n){ if(n<2) then return; else{ s=0; for(i=1;i<=8;i++){ Search(n/2); } for(i=1;i<n*n;i++){ for(j=1;j<n;j=j*2){ s=s+i; } } } } Assume s is a global variable.Find the complexity of the given Search(n)?
Consider the following code…..Search(int n){if(n<2)then return; else{s=0;for(i=1;i<=8;i++){Search(n/2);}for(i=1;i<n*n;i++){for(j=1;j<n;j=j*2){s=s+i;}}}}Assume s is a gl...
shaurya vardhan
658
views
shaurya vardhan
asked
Nov 2, 2017
Algorithms
time-complexity
algorithms
asymptotic-notation
recursion
programming-in-c
+
–
1
votes
0
answers
843
MST Kruskal
First statement is False because complexity will be O(E2). I think the second statement is true? But not sure
First statement is False because complexity will be O(E2).I think the second statement is true? But not sure
Shivam Chauhan
749
views
Shivam Chauhan
asked
Nov 2, 2017
Algorithms
algorithms
minimum-spanning-tree
time-complexity
prims-algorithm
+
–
5
votes
1
answer
844
Testbook Test Series
jaig
557
views
jaig
asked
Nov 1, 2017
Algorithms
algorithms
time-complexity
recurrence-relation
+
–
6
votes
2
answers
845
Min Heap
In a min-heap, the next largest element of a particular element can be found in ___ time. A) O(1) B) O(log n) C) O(n)
In a min-heap, the next largest element of a particular element can be found in ___ time.A) O(1)B) O(log n)C) O(n)
Shivam Chauhan
5.0k
views
Shivam Chauhan
asked
Oct 31, 2017
DS
data-structures
binary-heap
time-complexity
+
–
1
votes
1
answer
846
Fibonacci-Sequence
Which of the following is true about time complexity for generating $\color{blue} {n^{th}}$ Fibonacci number ? a)$O(n)$ b)$O(Logn)$ c)$O(2^n)$ d)$\Omega(n)$
Which of the following is true about time complexity for generating $\color{blue} {n^{th}}$ Fibonacci number ? a)$O(n)$b)$O(Logn)$c)$O(2^n)$d)$\Omega(n)$
Prabhanjan_1
1.8k
views
Prabhanjan_1
asked
Oct 30, 2017
Algorithms
algorithms
time-complexity
+
–
2
votes
1
answer
847
Finding Minimum
.........
.........
junaid ahmad
312
views
junaid ahmad
asked
Oct 29, 2017
Algorithms
algorithms
binary-search
time-complexity
numerical-answers
test-series
+
–
5
votes
0
answers
848
Time Complexity
//n is a prime number here int main() { for(i=1;i<=n;i=2*i) { for(j=1;j<=n;j++) { if(n%i==0) { k=1; while(k<=n) { a=b+c; k=k+1; } } } } }
//n is a prime number hereint main() { for(i=1;i<=n;i=2*i) { for(j=1;j<=n;j++) { if(n%i==0) { k=1; while(k<=n) { a=b+c; k=k+1; } } } } }
junaid ahmad
1.1k
views
junaid ahmad
asked
Oct 28, 2017
Algorithms
time-complexity
algorithms
+
–
0
votes
0
answers
849
MERGE SORT
IS 2 way merge sort and normal merge sort is same.in which we have to use bottom-up merging approach by taking 2-2 element inside the list.if 5-way merge sort then in the list we have to take 5-5 elements from bottom to up for merging. if I am wrong please let me correct!
IS 2 way merge sort and normal merge sort is same.in which we have to use bottom-up merging approach by taking 2-2 element inside the list.if 5-way merge sort then in the...
learner_geek
602
views
learner_geek
asked
Oct 28, 2017
Algorithms
merge-sort
algorithms
sorting
time-complexity
+
–
0
votes
1
answer
850
Algo doubt
An array a of unknown size is filled with special symbol let's say # . Time required to find the size of a is: Please give proper explanation
An array a of unknown size is filled with special symbol let's say # . Time required to find the size of a is:Please give proper explanation
Surya Dhanraj
491
views
Surya Dhanraj
asked
Oct 24, 2017
Algorithms
time-complexity
array
+
–
0
votes
1
answer
851
Algorithm doubt
In sorted array of size n time required to verify if there exist 2 number a and b such that a+ b = s in worst case Where s is a constant.
In sorted array of size n time required to verify if there exist 2 number a and b such that a+ b = s in worst case Where s is a constant.
Surya Dhanraj
419
views
Surya Dhanraj
asked
Oct 24, 2017
Algorithms
sorting
time-complexity
+
–
4
votes
1
answer
852
AceTest Series: Algorithms - Time Complexity
for (i=n ; i>0 ; i--) { for ( j=1;j<n ; j=j*2) { for ( k=0;k<j ;k++) { } } } time complexity ?? how to find of inner and innermost loop?
for (i=n ; i>0 ; i ) { for ( j=1;j<n ; j=j*2) { for ( k=0;k<j ;k++) { } } }time complexity ??how to find of inner and innermost loop?
aaru14
1.1k
views
aaru14
asked
Oct 23, 2017
Algorithms
ace-test-series
algorithms
time-complexity
+
–
3
votes
0
answers
853
T(n) = T ( n/2 ) + 2^n Applying Masters Theorem in this case.
$T(n) = T (n/2) + 2^n$ How can we apply masters theorem in this case?
$T(n) = T (n/2) + 2^n$How can we apply masters theorem in this case?
Manish Chetwani
1.1k
views
Manish Chetwani
asked
Oct 23, 2017
Algorithms
time-complexity
+
–
2
votes
1
answer
854
CLR 3rd Edition page no. 42 Q.n. c
Wha is the relationship between the running time of insertion sort and the number of inversions in the input array ? Is the circled text should be greater instead of less .Plz justify . PS: This image has been taken from solun manual of CLR.
Wha is the relationship between the running time of insertion sort and the number of inversions in the input array ?Is the circled text should be greater instead of less ...
dragonball
1.2k
views
dragonball
asked
Oct 21, 2017
Algorithms
algorithms
array
time-complexity
+
–
1
votes
2
answers
855
Self Doubt
What will be the time complexity of A() { int i,j,k,n; for(i=1;i<=n;i++) { for(j=1;j<=(i^2);j++) { for(k=1;k<=(n/2);k++) { printf("ABCD"); } } } }
What will be the time complexity of A() { int i,j,k,n; for(i=1;i<=n;i++) { for(j=1;j<=(i^2);j++) { for(k=1;k<=(n/2);k++) { printf("ABCD"); } } } }
Manish Chetwani
557
views
Manish Chetwani
asked
Oct 20, 2017
Algorithms
algorithms
time-complexity
+
–
1
votes
1
answer
856
Self Doubt
What will be the time complexity of the following code? A() { int i,j,k,n; for(i=1;i<=n;i++) { for(j=1;j<=i;j++) { for(k=1;k<=100;k++) { printf("ABCD"); } } } }
What will be the time complexity of the following code?A() { int i,j,k,n; for(i=1;i<=n;i++) { for(j=1;j<=i;j++) { for(k=1;k<=100;k++) { printf("ABCD"); } } } }
Manish Chetwani
337
views
Manish Chetwani
asked
Oct 20, 2017
Algorithms
time-complexity
algorithms
+
–
2
votes
1
answer
857
Algo:- Nuts and bolts
rahul sharma 5
931
views
rahul sharma 5
asked
Oct 18, 2017
Algorithms
algorithms
time-complexity
made-easy-test-series
+
–
5
votes
1
answer
858
Algo: Time complexity
T(n) = 4T(n/2) + n2.$\sqrt{2}$ In thetha notation?
T(n) = 4T(n/2) + n2.$\sqrt{2}$In thetha notation?
rahul sharma 5
699
views
rahul sharma 5
asked
Oct 18, 2017
Algorithms
time-complexity
algorithms
asymptotic-notation
+
–
0
votes
0
answers
859
Data Structure: Find 7th smallest element in Min heap
In a binary min heap with n elements, the 7th smallest element can be found in _____ ? Answer given is O(logn) and solution:- Delete the 1st smallest element O(logn) Delete the 2nd smallest element O(logn) .... ... this solution the data arrangement of the heap will be changed after performing these operation. any better solution than this???
In a binary min heap with n elements, the 7th smallest element can be found in _____ ?Answer given is O(logn) and solution:-Delete the 1st smallest element O(logn)Delete ...
Shubhanshu
1.5k
views
Shubhanshu
asked
Oct 18, 2017
Programming in C
binary-heap
time-complexity
algorithms
+
–
4
votes
1
answer
860
GATEFORUM
for(i=0;i<=n;i++){ for(j=0;j<=i2;j++){ for(k=0;k<=$\frac{n}{2}$;k++){ x=y+z; }}} How many times the x=y+z statement will execute?
for(i=0;i<=n;i++){ for(j=0;j<=i2;j++){ for(k=0;k<=$\frac{n}{2}$;k++){ x=y+z;}}}How many times the x=y+z statement will execute?
Abhi Girin
1.1k
views
Abhi Girin
asked
Oct 16, 2017
Programming in C
programming-in-c
time-complexity
for
loop
asymptotic-notation
normal
+
–
0
votes
0
answers
861
Time complexity
dragonball
580
views
dragonball
asked
Oct 15, 2017
Algorithms
time-complexity
algorithms
asymptotic-notation
bad-question
+
–
1
votes
1
answer
862
Master Theorem
dragonball
525
views
dragonball
asked
Oct 15, 2017
Algorithms
algorithms
master-theorem
time-complexity
test-series
+
–
1
votes
2
answers
863
Alo doubt
Complexity of equation - T(n)=. 2T(n-1)-1 if n>0 1. Otherwise
Complexity of equation -T(n)=. 2T(n-1)-1 if n>0 1. Otherwise
Surya Dhanraj
529
views
Surya Dhanraj
asked
Oct 15, 2017
Algorithms
recurrence-relation
time-complexity
+
–
0
votes
1
answer
864
time complexity
time taken to delete a node from min heap if you know the value but not position To find the position of the number in min heap should not be log(n) why is it so O(n)
time taken to delete a node from min heap if you know the value but not positionTo find the position of the number in min heap should not be log(n)why is it so O(n)
Kaluti
439
views
Kaluti
asked
Oct 14, 2017
DS
data-structures
binary-heap
time-complexity
+
–
3
votes
2
answers
865
Time complexity
Given a 2D array X[m][n] which has m rows and n columns. The array X is row wise and column wise sorted (i.e) each individula row and column is sorted. What is the complexity to search an element in this array a)O(m*n) b)O(m2) or O(n2) c)O(log2(m*n)) d)O(m+n)
Given a 2D array X[m][n] which has m rows and n columns. The array X is row wise and column wise sorted (i.e) each individula row and column is sorted. What is the comple...
A_i_$_h
847
views
A_i_$_h
asked
Oct 12, 2017
Algorithms
sorting
time-complexity
+
–
4
votes
1
answer
866
Merge sort
True or False Merge sort on Linked list takes O(nlogn)
True or FalseMerge sort on Linked list takes O(nlogn)
Shivi rao
1.5k
views
Shivi rao
asked
Oct 10, 2017
DS
merge-sort
algorithms
sorting
time-complexity
+
–
1
votes
1
answer
867
Long integer multiplication
Given 2 long integers having n digits , it is required to multiply them.Assuming the numbers are represented in an array of size n . The time complexity to multiply them using traditional divide and conquer is
Given 2 long integers having n digits , it is required to multiply them.Assuming the numbers are represented in an array of size n . The time complexity to multiply them ...
A_i_$_h
1.1k
views
A_i_$_h
asked
Oct 10, 2017
Algorithms
time-complexity
divide-and-conquer
+
–
2
votes
1
answer
868
priority based scheduling
Given that ready contains at some point of time a maximum of n process , the time complexity to schedule and dispatch a process from ready queue onto CPU using priority based scheduling is a)O(n) b)O(logn) c)O(nlogn) d)O(1)
Given that ready contains at some point of time a maximum of n process , the time complexity to schedule and dispatch a process from ready queue onto CPU using priority ...
A_i_$_h
1.2k
views
A_i_$_h
asked
Oct 9, 2017
Algorithms
algorithms
time-complexity
job-scheduling
+
–
3
votes
1
answer
869
Time complexity
Solve the following recurrence relation $T(n)=4T(n/2)+n^2 \sqrt 2$
Solve the following recurrence relation$T(n)=4T(n/2)+n^2 \sqrt 2$
Shivi rao
767
views
Shivi rao
asked
Oct 9, 2017
Algorithms
time-complexity
algorithms
asymptotic-notation
+
–
1
votes
0
answers
870
General Doubt Regarding Calculating Algorithm Complexity
While going through some solutions of calculating algorithm complexity, i came across this statement $\frac{1}{1} + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + ........ + \frac{1}{n} = logn$ For example this is one question ... and Log (1) = 0, even basis is not true. Let me know what i am missing, and is this the correct expansion of log n
While going through some solutions of calculating algorithm complexity, i came across this statement$\frac{1}{1} + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + ........ + \f...
stblue
295
views
stblue
asked
Oct 9, 2017
Algorithms
algorithms
time-complexity
+
–
Page:
« prev
1
...
24
25
26
27
28
29
30
31
32
33
34
...
53
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register