Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged time-complexity
6
votes
1
answer
331
Made Easy Test Series:Algorithm-Time Complexity
Consider a procedure $find()$ which take array of $n$ integers as input, and produce pair of element of array whose difference is not greater than the difference of any other pair of element of that array. Which of the following represent ... Here we need to sort first and then need to compare adjacent element right?? Then what will be complexity??
Consider a procedure $find()$ which take array of $n$ integers as input, and produce pair of element of array whose difference is not greater than the difference of any o...
srestha
2.1k
views
srestha
asked
May 18, 2019
Algorithms
algorithms
made-easy-test-series
time-complexity
+
–
1
votes
0
answers
332
Made Easy Test Series: Algorithm-Reverse Polish Notation
Consider the new-order strategy for traversing a binary tree: Visit the root Visit the right subtree using new-order Visit the left subtree using new-order The new-order traversal of expression tree corresponding to the reverse polish expression 3 4 * 5 – 2 ^ 6 7 * 1 + – What will be expression, any procedure for it??
Consider the new-order strategy for traversing a binary tree:Visit the rootVisit the right subtree using new-orderVisit the left subtree using new-orderThe new-order trav...
srestha
586
views
srestha
asked
May 16, 2019
Compiler Design
infix-prefix
algorithms
time-complexity
+
–
1
votes
2
answers
333
Made Easy Test Series:Algorithm-Recurrence Relation
What is the solution of recurrence relation $T\left ( n \right )=T\left ( n-1 \right )+n$
What is the solution of recurrence relation$T\left ( n \right )=T\left ( n-1 \right )+n$
srestha
874
views
srestha
asked
May 10, 2019
Algorithms
algorithms
time-complexity
recurrence-relation
+
–
2
votes
0
answers
334
GO screening test
Which one of the following notations is most relevant for finding the best algorithm for a problem? (A) $o(f(n))$ (B) $O(f(n))$ (C) $\omega (f(n))$ (D) $ \Omega (f(n))$
Which one of the following notations is most relevant for finding the best algorithm for a problem?(A) $o(f(n))$(B) $O(f(n))$(C) $\omega (f(n))$(D) $ \Omega (f(n))$
toxicdesire
889
views
toxicdesire
asked
May 9, 2019
Algorithms
time-complexity
algorithms
go-screening-test
+
–
0
votes
1
answer
335
analysis of algorithm
pradeepchaudhary
864
views
pradeepchaudhary
asked
May 9, 2019
Algorithms
recurrence-relation
time-complexity
geeksforgeeks-test-series
+
–
6
votes
1
answer
336
Made Easy Test Series:Time Complexity
Consider the following program: int Bar(int n){ if(n<2) return; } else{ int sum=0; int i,j; for(i=1;i<=4;i++) Bar(n/2); for(i=1;i<=n;i++){ for(j=1;j<=i;j++){ sum=sum+1; } } } Now consider the following ... $Bar\left ( n \right )$ is $O \left ( n^{3}logn^{2} \right )$ How many statements are correct________________
Consider the following program:int Bar(int n){ if(n<2) return; } else{ int sum=0; int i,j; for(i=1;i<=4;i++) Bar(n/2); for(i=1;i<=n;i++){ for(j=1;j<=i;j++){ sum=sum+1; } ...
srestha
2.4k
views
srestha
asked
May 7, 2019
Algorithms
made-easy-test-series
algorithms
time-complexity
+
–
3
votes
4
answers
337
IIIT PGEE 2019
What is the time complexity to delete an arbitrary node from binary heap? O(n) O(log n) O(1) O(n log n)
What is the time complexity to delete an arbitrary node from binary heap?O(n)O(log n)O(1)O(n log n)
manikgupta123
1.8k
views
manikgupta123
asked
Apr 29, 2019
Programming in C
iiith-pgee
time-complexity
binary-heap
+
–
1
votes
4
answers
338
IIIT PGEE 2019
Which of the following gives O(1) complexity if we want to check whether an edge exists between two given nodes in a graph? Adjacency List Adjacency Matrix Incidence Matrix None of these
Which of the following gives O(1) complexity if we want to check whether an edge exists between two given nodes in a graph?Adjacency ListAdjacency MatrixIncidence MatrixN...
manikgupta123
1.3k
views
manikgupta123
asked
Apr 29, 2019
DS
iiith-pgee
graph-theory
time-complexity
+
–
3
votes
4
answers
339
IIIT PGEE 2019
What is the time complexity for insertion in binary tree in worst case? O(1) O(log n) O(n) O(n log n)
What is the time complexity for insertion in binary tree in worst case?O(1)O(log n)O(n)O(n log n)
manikgupta123
1.7k
views
manikgupta123
asked
Apr 28, 2019
Programming in C
iiith-pgee
binary-tree
time-complexity
+
–
1
votes
1
answer
340
Made Easy Test Series:Algorithm
Given a sorted array of distinct integer $A\left [ 1,2,....n \right ]$, the tightest upper bound to check the existence of any index $i$, for which $A[i]=i$ ... index and then checking if $A[i]=i$, but answer given as $O(log n).$Please help me out, which will be correct answer?
Given a sorted array of distinct integer $A\left [ 1,2,....n \right ]$, the tightest upper bound to check the existence of any index $i$, for which $A[i]=i$ is equal to _...
srestha
786
views
srestha
asked
Apr 28, 2019
Algorithms
made-easy-test-series
sorting
time-complexity
+
–
1
votes
1
answer
341
If there is an $\rm NP$-complete language $L$ whose complement is in $\rm NP$, then...
If there is an $\rm NP$-complete language $L$ whose complement is in $\rm NP$, then the complement of any language in $\rm NP$ is in $\rm NP$ $\rm P$ Both (a) and (b) None of these
If there is an $\rm NP$-complete language $L$ whose complement is in $\rm NP$, then the complement of any language in $\rm NP$ is in$\rm NP$$\rm P$Both (a) and (b)None of...
Rhythm
1.4k
views
Rhythm
asked
Apr 20, 2019
Theory of Computation
theory-of-computation
time-complexity
p-np-npc-nph
+
–
0
votes
1
answer
342
Made Easy Test Series : Algorithm
for(k=1;k<(n+1);k++) { for(m=1;m<(n+1);m+=k){ x=x+1; } } What is the T.C. of the following code? Is it $n^{2}$ or $n\log n$??
for(k=1;k<(n+1);k++) { for(m=1;m<(n+1);m+=k){ x=x+1; } }What is the T.C. of the following code?Is it $n^{2}$ or $n\log n$??
srestha
626
views
srestha
asked
Apr 20, 2019
Algorithms
made-easy-test-series
time-complexity
+
–
1
votes
1
answer
343
Find Asymptotic upper bound (http://www.csd.uwo.ca/~moreno/CS433-CS9624/Resources/master.pdf)
$\Large T(n) = 2^nT(\frac{n}{2}) + n^n$
$\Large T(n) = 2^nT(\frac{n}{2}) + n^n$
Mk Utkarsh
947
views
Mk Utkarsh
asked
Apr 19, 2019
Algorithms
asymptotic-notation
time-complexity
+
–
1
votes
1
answer
344
Algorithm Time Complexity-Self Doubt
What is the best case and worst case of the algorithm? And when will best case and worst case will happen?? int main() { for(i=1 ; i<=n ; i++) { if(n%i == 0) { for(j=1 ; j<=n ; j++) { printf("Hello"); } } } }
What is the best case and worst case of the algorithm? And when will best case and worst case will happen??int main() { for(i=1 ; i<=n ; i++) { if(n%i == 0) { for(j=1 ; j...
sumitr
1.3k
views
sumitr
asked
Apr 10, 2019
Algorithms
algorithms
time-complexity
self-doubt
+
–
0
votes
1
answer
345
MOCK TEST
Consider an array consisting of –ve and +ve numbers. What would be the worst time comparisons an algorithm can take in order to segregate the numbers having same sign altogether i.e all +ve on one side and then all -ve on the other? a)N-1 b)N c)N+1 d) (N*(N-1))/2 answer given is a)
Consider an array consisting of –ve and +ve numbers. What would be the worst time comparisons an algorithm can take in order to segregate the numbers having same sign a...
Dipanshu Rana
389
views
Dipanshu Rana
asked
Mar 22, 2019
Algorithms
time-complexity
algorithm-design
test-series
+
–
1
votes
1
answer
346
Time complexity
Please help to find the time complexity of this loop. void main() { int n; while(n>=1) { n=n-2; } }
Please help to find the time complexity of this loop. void main(){int n;while(n>=1){n=n-2;}}
Devshree Dubey
684
views
Devshree Dubey
asked
Mar 19, 2019
Algorithms
time-complexity
algorithms
+
–
0
votes
2
answers
347
Self doubt
O(n-1)+O(n)=O(n) O(n/2)+O(n)=O(n) but O(1)+O(2)+O(3)+...+O(n)=O(n(n+1)/2)=O(n^2) why?
O(n-1)+O(n)=O(n)O(n/2)+O(n)=O(n)but O(1)+O(2)+O(3)+...+O(n)=O(n(n+1)/2)=O(n^2)why?
Tanuj Guha Thakurta
486
views
Tanuj Guha Thakurta
asked
Mar 19, 2019
Algorithms
time-complexity
asymptotic-notation
+
–
1
votes
1
answer
348
Data Structure and Algorithm for Gate by Narasimha Karumanchi# Algorithm Introduction#
Find the complexity of below pseudocode. temp = 1 repeat for i=1 to n temp=temp +1; n=n/2; until n<= 1
Find the complexity of below pseudocode.temp = 1repeat for i=1 to n temp=temp +1; n=n/2;until n<= 1
Prakhar Garg
1.2k
views
Prakhar Garg
asked
Mar 18, 2019
Algorithms
algorithms
time-complexity
+
–
1
votes
0
answers
349
Time complexity
Is this the correct way to solve ? Q) int algorithm(int n) { int sum =0;k,j; for (k=0;k<n/2;k++) for(j=0;j<10;j++) sum++; return 4*algorithm(n/2)*algorithm(n/2)+algorithm(n/2)*algorithm(n/2) }
Is this the correct way to solve ?Q) int algorithm(int n){ int sum =0;k,j; for (k=0;k<n/2;k++) for(j=0;j<10;j++) sum++; return 4*algorithm(n/2)*algorit...
syncronizing
1.3k
views
syncronizing
asked
Mar 15, 2019
Algorithms
time-complexity
algorithms
recurrence-relation
+
–
1
votes
1
answer
350
JEST Sample Question-4
A tournament is a directed graph in which there is exactly one directed edge between every pair of vertices. Let Tn be a tournament on n vertices. (a) Use induction to prove the following statement: Tn has a directed hamiltonian path (a directed ... or a simple description of the steps in the algorithm, will suffice. What is the worst case time complexity of your algorithm?
A tournament is a directed graph in which there is exactly one directed edge betweenevery pair of vertices. Let Tn be a tournament on n vertices.(a) Use induction to prov...
sripo
811
views
sripo
asked
Feb 15, 2019
Algorithms
jest
algorithms
time-complexity
+
–
1
votes
1
answer
351
JEST Sample Question-5
Describe two different data structures to represent a graph. For each such representation, specify a simple property about the graph that can be more efficiently checked in that representation than in the other representation. Indicate the worst case time required for verifying both of your properties in either representation.
Describe two different data structures to represent a graph. For each such representation, specify a simple property about the graph that can be more efficiently checked ...
sripo
720
views
sripo
asked
Feb 15, 2019
Algorithms
jest
algorithms
time-complexity
+
–
0
votes
2
answers
352
iit written test
what is the time complexity to find the determinant of a n*n upper triangular matrix in terms of n?
what is the time complexity to find the determinant of a n*n upper triangular matrix in terms of n?
utpal podder
378
views
utpal podder
asked
Feb 13, 2019
Algorithms
time-complexity
+
–
0
votes
1
answer
353
mid exam
Hi everyone. I’ve gone through this two issues and solved them, please correct me if something looks wrong. thanks. sum1=0 for(k=1; k<=n; k*2) for(j=1; j <= n; j++) sum1++; Sigma from k=1 to n/2 sigma from j=1 to n (1) = Sigma from k=1 to n/2 (n)= n/2 * n = n^2/2 sum2=0; for(k=1;k<=n;k*=2) for(j=1; j<=k; j++) sum2++; (n/2(n/2-1))/2=((n^2/4)-(n/2))/2=(n^2-2n)/n
Hi everyone.I’ve gone through this two issues and solved them, please correct me if something looks wrong.thanks.sum1=0for(k=1; k<=n; k*2)for(j=1; j <= n; j++)sum1++;Si...
miller
423
views
miller
asked
Feb 11, 2019
Algorithms
algorithms
time-complexity
+
–
47
votes
8
answers
354
GATE CSE 2019 | Question: 37
There are $n$ unsorted arrays: $A_1, A_2, \dots, A_n$. Assume that $n$ is odd.Each of $A_1, A_2, \dots, A_n$ contains $n$ distinct elements. There are no common elements between any two arrays. The worst-case time complexity of computing the median of the medians of $A_1, A_2, \dots , A_n$ is $O(n)$ $O(n \: \log \: n)$ $O(n^2)$ $\Omega (n^2 \log n)$
There are $n$ unsorted arrays: $A_1, A_2, \dots, A_n$. Assume that $n$ is odd.Each of $A_1, A_2, \dots, A_n$ contains $n$ distinct elements. There are no common elements ...
Arjun
35.3k
views
Arjun
asked
Feb 7, 2019
Algorithms
gatecse-2019
algorithms
time-complexity
2-marks
+
–
1
votes
0
answers
355
Can Merge Sort Time Complexity be O(n^2) in any condition?
aditykansara
1.3k
views
aditykansara
asked
Jan 31, 2019
Algorithms
algorithms
time-complexity
sorting
+
–
4
votes
1
answer
356
ME Mock 4
Consider a new sorting algorithm similar to the BubbleSort algorithm, called RumbleSort. Given an array as input, RumbleSort attempts to sort the array and produces a sorted array as output. Here's the pseudo-code for RumbleSort. With regards to the above RumbleSort ... algorithm will work correctly for a given input is $\mathcal Ο(n^2)$ Which of the above statements is/are true?
Consider a new sorting algorithm similar to the BubbleSort algorithm, called RumbleSort. Given an array as input, RumbleSort attempts to sort the array and produces a sor...
balchandar reddy san
1.3k
views
balchandar reddy san
asked
Jan 30, 2019
Algorithms
time-complexity
algorithms
sorting
made-easy-test-series
+
–
0
votes
1
answer
357
Ace dlp
for(i=n, j=0; i>0; i/=2, j+=i) Let val(j) denote the value stored in the variable j after termination of the for loop. Whjch is correct? a. val(j)=theta(logn) b. Val(j)= theta(√n) c. Val(j) = theta(n) d. Val(j) = theta(nlogn)
for(i=n, j=0; i>0; i/=2, j+=i)Let val(j) denote the value stored in the variable j after termination of the for loop. Whjch is correct?a. val(j)=theta(logn)b. Val(j)= the...
gate_dreams
373
views
gate_dreams
asked
Jan 27, 2019
Algorithms
ace-booklet
algorithms
time-complexity
+
–
1
votes
2
answers
358
from edurev
Consider an interpolation search which is an improvement over binary search where the values in a sorted array are uniformly distributed.In interpolation search construction of new data points take place at different location according to the value of the key being searched.Find the time complexity ... . A.O(logn) B.O(n) C.O(n logn) D.O(log(logn)) Please explain by taking an example
Consider an interpolation search which is an improvement over binary search where the values in a sorted array are uniformly distributed.In interpolation search construct...
Megha_2019
575
views
Megha_2019
asked
Jan 26, 2019
Algorithms
algorithms
time-complexity
+
–
1
votes
1
answer
359
Random Doubt in f(n)=O(n^2)
Can any one please help me out in understanding how to read : f(n)=O(n^2) I am confused in : 1] f(n) is the upper bound of n^2 2]f(n)’s upper bound is n^2 Or is their any another way of reading it out…! THANK YOU
Can any one please help me out in understanding how to read :f(n)=O(n^2)I am confused in :1] f(n) is the upper bound of n^22]f(n)’s upper bound is n^2Or is their any a...
Nandkishor3939
265
views
Nandkishor3939
asked
Jan 25, 2019
Algorithms
algorithms
time-complexity
+
–
1
votes
1
answer
360
Recurrence relation and Time Complexity
What is the time complexity of the following recurrence relation and step to derive the same $T(n) = T(\sqrt{n}) + log(logn)$
What is the time complexity of the following recurrence relation and step to derive the same$T(n) = T(\sqrt{n}) + log(logn)$
VikramRB
1.0k
views
VikramRB
asked
Jan 20, 2019
Algorithms
time-complexity
algorithms
recurrence-relation
+
–
Page:
« prev
1
...
7
8
9
10
11
12
13
14
15
16
17
...
53
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register