Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged time-complexity
0
votes
1
answer
511
time-complexcity
for(i=0;i<n;i++) for(j=0;j<i;j++) for(k=0;k<j;k++) what is the time complexity of above psudo code? explain.
for(i=0;i<n;i++) for(j=0;j<i;j++) for(k=0;k<j;k++) what is the time complexity of above psudo code?explain.
balaganesh
447
views
balaganesh
asked
Sep 21, 2018
Algorithms
time-complexity
algorithms
asymptotic-notation
+
–
0
votes
1
answer
512
#sorting
Consider an array contains n distinct elements and we need to sort them in nondecreasing order as follows: First find the minimum, remove this element from the array and find the minimum of the remaining elements, remove this element and so on until array become empty. In the best case, how many comparisons are needed? A.O(n) B.O(n2) C.O(nlogn) D.None of the above
Consider an array contains n distinct elements and we need to sort them in nondecreasing order as follows: First find the minimum, remove this element from the array an...
sudharshan
948
views
sudharshan
asked
Sep 21, 2018
Algorithms
algorithms
sorting
time-complexity
+
–
0
votes
1
answer
513
TIME COMPLEXITY
i=n; while(i>0) { j=1; while(j<=n) { j=2*j; } i=i/2; }
i=n;while(i>0){j=1;while(j<=n){j=2*j;}i=i/2;}
Umar Hayat
206
views
Umar Hayat
asked
Sep 21, 2018
Algorithms
algorithms
time-complexity
+
–
0
votes
1
answer
514
Algorithms Complexity
Vaishnavi01
660
views
Vaishnavi01
asked
Sep 20, 2018
Algorithms
algorithms
time-complexity
asymptotic-notation
+
–
0
votes
1
answer
515
conceptual doubt
WHAT IS THE TIME COMPLEXITY TO ENQUEUE AN ELEMENT IF THE QUEUE IS IMPLEMENTED AS A CIRCULAR QUEUE AND WE HAVE GOT ONLY ONE POINTER TO FRONT ELEMENT??
WHAT IS THE TIME COMPLEXITY TO ENQUEUE AN ELEMENT IF THE QUEUE IS IMPLEMENTED AS A CIRCULAR QUEUE AND WE HAVE GOT ONLY ONE POINTER TO FRONT ELEMENT??
sushmita
1.1k
views
sushmita
asked
Sep 20, 2018
DS
data-structures
linked-list
time-complexity
queue
+
–
1
votes
1
answer
516
Algorithms::Ace academy test series question
Can anyone explain me the answer in detail?
Can anyone explain me the answer in detail?
phaneendrababu
691
views
phaneendrababu
asked
Sep 20, 2018
Algorithms
ace-test-series
time-complexity
+
–
0
votes
1
answer
517
ISI2017-PCB-CS-4
A file $F$ holds the non-zero elements of two large $n \times n$ matrices, $a$ and $B$. The matrix entries are sorted as triplets $(i, j, \text{value})$, where $\text{value}$ is the $(i,j)$th element of a matrix. The file first ... If no, give reasons. If yes, provide a solution. Clearly explain the data structure and how you are going to store, retrieve, and add the elements.
A file $F$ holds the non-zero elements of two large $n \times n$ matrices, $a$ and $B$. The matrix entries are sorted as triplets $(i, j, \text{value})$, where $\text{val...
go_editor
574
views
go_editor
asked
Sep 20, 2018
Algorithms
isi2017-pcb-cs
algorithms
time-complexity
descriptive
+
–
0
votes
0
answers
518
ISI2017-PCB-CS-6
Let $A=(a_1, a_2, \dots , a_n)$ be an array of $n$ distinct numbers. The array may not be sorted. The $\text{first}$ element $a_1$ is said to be a $\text{blip}$ if $a_1 > a_2$. Similarly, the $\text{last}$ element $a_n$ ... $O(\log n)$ time algorithm for finding a $\text{blip}$ in $A$. Justify the complexity of your algorithm.
Let $A=(a_1, a_2, \dots , a_n)$ be an array of $n$ distinct numbers. The array may not be sorted. The $\text{first}$ element $a_1$ is said to be a $\text{blip}$ if $a_1 ...
go_editor
425
views
go_editor
asked
Sep 20, 2018
Algorithms
isi2017-pcb-cs
algorithms
time-complexity
descriptive
+
–
1
votes
2
answers
519
Ace Test Series: Algorithms - Time Complexity Notation
If t(n) and s(n) denotes the time and space complexity of an algorithm with input size n element then which one of the following is always true? S(n)=O(t(n)) correct How???
If t(n) and s(n) denotes the time and space complexity of an algorithm with input size n element then which one of the following is always true?S(n)=O(t(n)) correct H...
akankshadewangan24
843
views
akankshadewangan24
asked
Sep 20, 2018
Algorithms
ace-test-series
algorithms
time-complexity
+
–
1
votes
1
answer
520
Algorithm
Deleting any random element in heap would take n+logn or n+n?
Deleting any random element in heap would take n+logn or n+n?
Raghav Khajuria
528
views
Raghav Khajuria
asked
Sep 17, 2018
Algorithms
time-complexity
+
–
0
votes
1
answer
521
Time complexity of code given
GateAspirant999
940
views
GateAspirant999
asked
Sep 16, 2018
Algorithms
algorithms
sorting
time-complexity
numerical-answers
test-series
+
–
0
votes
1
answer
522
what is the time complexity of this code
highheels10
474
views
highheels10
asked
Sep 15, 2018
Algorithms
time-complexity
+
–
0
votes
0
answers
523
Time complexity of given code using "finite" geometric series
Solved!!!
Solved!!!
GateAspirant999
257
views
GateAspirant999
asked
Sep 15, 2018
Mathematical Logic
time-complexity
algorithms
+
–
0
votes
1
answer
524
merge sort
n sorted subarrays each of size log n. find single sorted array with all elements.find time complexity
n sorted subarrays each of size log n. find single sorted array with all elements.find time complexity
shipra tressa
545
views
shipra tressa
asked
Sep 15, 2018
Algorithms
sorting
merge-sort
time-complexity
+
–
1
votes
2
answers
525
self doubt
time complexity to find the n/2 largest element in max heap ?\ it must be nlogn
time complexity to find the n/2 largest element in max heap ?\it must be nlogn
sajal singh
276
views
sajal singh
asked
Sep 14, 2018
Algorithms
algorithms
time-complexity
+
–
0
votes
1
answer
526
algorithm
A new algorithm MaxPack for optimally packing furniture in a transportation container claims to have worst case complexity O(n2 log n), where n is the number of items to be packed. From this, we can conclude that: 1.For every sufficiently large n, for every input ... large n, there is an input of size n for which MaxPack requires time proportional to n2 log n. which option is correct?
A new algorithm MaxPack for optimally packing furniture in a transportation container claims to have worst case complexity O(n2 log n), where n is the number of items to ...
Neeraj_gate19
485
views
Neeraj_gate19
asked
Sep 12, 2018
Algorithms
time-complexity
+
–
0
votes
1
answer
527
TESTBOOK TEST SERIES
Avik Chowdhury
626
views
Avik Chowdhury
asked
Sep 12, 2018
Algorithms
time-complexity
testbook-test-series
+
–
0
votes
3
answers
528
Time complexity 14
Deepalitrapti
903
views
Deepalitrapti
asked
Sep 12, 2018
Algorithms
sorting
algorithms
time-complexity
test-series
+
–
0
votes
1
answer
529
SELF DOUBT
If you are given a sorted list with n elements in ascending order. Then what will be the Time complexity to build a Min heap from the given array?
If you are given a sorted list with n elements in ascending order. Then what will be the Time complexity to build a Min heap from the given array?
Deepanshu
628
views
Deepanshu
asked
Sep 12, 2018
DS
data-structures
binary-heap
time-complexity
+
–
0
votes
1
answer
530
Time complexity
Deepalitrapti
314
views
Deepalitrapti
asked
Sep 11, 2018
Algorithms
sorting
merge-sort
time-complexity
+
–
0
votes
1
answer
531
class book
C function let n>=m. int gcd(n,m) { if(n%m==0) return m; n=n%m; return gcd(m,n); } time complexity
C function let n>=m.int gcd(n,m){if(n%m==0) return m;n=n%m;return gcd(m,n);} time complexity
amit166
224
views
amit166
asked
Sep 11, 2018
Algorithms
time-complexity
+
–
0
votes
2
answers
532
class notes
find time complexity f(int n){ int i=1; while(i<n) { int j=n; while(j>0) j=j/2; i=i*2; } }
find time complexityf(int n){int i=1;while(i<n){int j=n;while(j>0)j=j/2;i=i*2;}}
amit166
212
views
amit166
asked
Sep 11, 2018
Algorithms
time-complexity
+
–
0
votes
1
answer
533
gatebook
Q2. int A(int) { if(n<=2) return 1; else return (A(√n)+n); } time complexity
Q2.int A(int){if(n<=2) return 1;elsereturn (A(√n)+n);} time complexity
amit166
198
views
amit166
asked
Sep 11, 2018
Algorithms
time-complexity
recurrence-relation
gatebook-test-series
+
–
0
votes
2
answers
534
gatebook
Q.1 int A(int n){ if(n==2) return 1; else{ for(int j=1;j<=n;j++) printf(" * "); return(A(√n)); } } Time complexity
Q.1 int A(int n){if(n==2) return 1;else{for(int j=1;j<=n;j++)printf(" * ");return(A(√n));}} Time complexity
amit166
313
views
amit166
asked
Sep 11, 2018
Algorithms
time-complexity
gatebook-test-series
+
–
0
votes
0
answers
535
Time Complexity
Please help with the following in Time Complexity. 1)Show that the following order-of-magnitude results hold: a)3n=O(n!) b)(n3 -2n)/(n+1)=theta(n2) c)n3 /log(n+1)=O(n3) but not O(n2) 2)What is wrong with the following argument? x=O(n4),y=O(n2),therefore x/y=O(n2). 3) What is ... the following argument? f(n)=O(n2)+O(n), so that f(n)-g(n)=O(n2 )+O(n)-O(n2). Therefore, f(n)-g(n)=O(n)
Please help with the following in Time Complexity. 1)Show that the following order-of-magnitude results hold:a)3n=O(n!)b)(n3 -2n)/(n+1)=theta(n2)c)n3 /log(n+1)=O(n3) but ...
Devshree Dubey
479
views
Devshree Dubey
asked
Sep 10, 2018
Algorithms
time-complexity
algorithms
asymptotic-notation
+
–
0
votes
0
answers
536
No. of comparison in min heap
What is the number of comparisons required to extract 45th element of the min heap?
What is the number of comparisons required to extract 45th element of the min heap?
bts1jimin
1.8k
views
bts1jimin
asked
Sep 10, 2018
Algorithms
algorithms
binary-heap
time-complexity
+
–
0
votes
0
answers
537
#book
Q.1 int A(int n){ if(n==2) return 1; else{ for(int j=1;j<=n;j++) printf("*"); return(A$(\sqrt{n})$); } } Time complexity Q.3 C function let n>=m. int gcd(n,m) { if(n%m==0) return m; n=n%m; return gcd(m,n); } time complexity Q.4 find time complexity f( ... ; while(j>0) j=j/2; i=i*2; } } Q2. int A(int) { if(n<=2) return 1; else return (A$(\sqrt{n})$+n); } time complexity
Q.1 int A(int n){if(n==2) return 1;else{for(int j=1;j<=n;j++)printf("*");return(A$(\sqrt{n})$);}} Time complexity Q.3 C function let n>=m.int gcd(n,m){if(n%m==0) return ...
amit166
227
views
amit166
asked
Sep 9, 2018
Algorithms
time-complexity
+
–
0
votes
1
answer
538
Complexity Question Based on array
Given an array A of size n*n, consists of 1's and 0's such that , in any row of A, all the 1's come before any 0's in that row. Assuming A is already in memory, what is the complexity of the most efficient algorithm for finding the row of A that contains the most 1's. A. O(n^2) B. O(n) C. O(log n) D. O(nlogn)
Given an array A of size n*n, consists of 1's and 0's such that , in any row of A, all the 1's come before any 0's in that row. Assuming A is already in memory, what is t...
Vaishnavi01
249
views
Vaishnavi01
asked
Sep 7, 2018
Algorithms
algorithms
array
time-complexity
+
–
0
votes
1
answer
539
Solve this Q
Consider the following C code segment int f (int x) { if (x < 1) return 1; else return (f(x-1) + g(x)) } int g (int x) { if (x < 2) return 2; else return (f(x-1) + g(x/2)); } Of the following, which best describes the growth of f(x) as a function of x? (A) Linear (B) Exponential (C) Quadratic (D) Cubic
Consider the following C code segmentint f (int x) { if (x < 1) return 1; else return (f(x-1) + g(x)) } int g (int x) { if (x < 2) return 2; else return (f(x-1) + g(x/2))...
kallu singh
608
views
kallu singh
asked
Sep 7, 2018
Algorithms
time-complexity
recursion
+
–
0
votes
0
answers
540
Algorithm
How is Σ (1/k * log k) = O( n log n) for k=1 to n?
How is Σ (1/k * log k) = O( n log n) for k=1 to n?
Nidhi Budhraja
325
views
Nidhi Budhraja
asked
Sep 7, 2018
Algorithms
algorithms
time-complexity
asymptotic-notation
+
–
Page:
« prev
1
...
13
14
15
16
17
18
19
20
21
22
23
...
53
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register