Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage for Algorithms
Recent questions tagged algorithms
0
votes
0
answers
1111
IIT Delhi
Churchill Khangar
479
views
Churchill Khangar
asked
Nov 22, 2018
Algorithms
algorithms
p-np-npc-nph
+
–
0
votes
0
answers
1112
#self_doubt
no of max heaps possible with nos given as 1,2,3,4,5? I am getting 8 if you get more please upload solution and do not give direct answers!
no of max heaps possible with nos given as 1,2,3,4,5?I am getting 8 if you get more please upload solution and do not give direct answers!
Dheer
349
views
Dheer
asked
Nov 22, 2018
Algorithms
algorithms
max-heap
+
–
1
votes
1
answer
1113
How is the time Complexity of this problem O(n log log n)?
int A(int n){ for(i = 1; i < n; i++) for(j = 1; j < i; j *= 2) for(k = j; k >= 1; k /= 2) if(n = 0) return 1; else{ for(z = 0; z < n; z++){ // do something } } } How do find the complexity of this problem? The answer is supposed to be O(n log log n), but it maybe wrong.
int A(int n){ for(i = 1; i < n; i++) for(j = 1; j < i; j *= 2) for(k = j; k >= 1; k /= 2) if(n = 0) return 1; else...
gmrishikumar
4.2k
views
gmrishikumar
asked
Nov 22, 2018
Algorithms
algorithms
time-complexity
recurrence-relation
programming-in-c
+
–
1
votes
1
answer
1114
MadeEasy Test Series: Algorithms - Time Complexity
Shamim Ahmed
826
views
Shamim Ahmed
asked
Nov 22, 2018
Algorithms
made-easy-test-series
algorithms
time-complexity
+
–
0
votes
1
answer
1115
MadeEasy Test Series: Algorithms - Time Complexity
For merging two unsorted list of size m and n into sorted list of size (m+n). The time complexity in terms of no. of comparison for this is?
For merging two unsorted list of size m and n into sorted list of size (m+n). The time complexity in terms of no. of comparison for this is?
Shamim Ahmed
1.1k
views
Shamim Ahmed
asked
Nov 22, 2018
Algorithms
made-easy-test-series
algorithms
time-complexity
+
–
4
votes
2
answers
1116
T(n) = sqrt(n) * T(sqrt(n)) + n
T(n) = sqrt(n) * T(sqrt(n)) + n Given solution is O(log log n). But my solution is O(n log log n). 'wolframalpha'' shows the answer same as mine. You can find the solution here. Can anyone confirm the solution and provide an explantion?
T(n) = sqrt(n) * T(sqrt(n)) + n Given solution is O(log log n). But my solution is O(n log log n).'wolframalpha'' shows the answer same as mine. You can find the solution...
gmrishikumar
11.8k
views
gmrishikumar
asked
Nov 22, 2018
Algorithms
algorithms
recurrence-relation
time-complexity
+
–
0
votes
1
answer
1117
BFS TRAVERSAL
HOW CAN WE GET A CROSS EDGE WHILE PERFORMING A BFS ON UNDIRECTED AND DIRECTED GRAPH CAN ANYONE SHOW WITH AN EXAMPLE?
HOW CAN WE GET A CROSS EDGE WHILE PERFORMING A BFS ON UNDIRECTED AND DIRECTED GRAPH CAN ANYONE SHOW WITH AN EXAMPLE?
codingo1234
387
views
codingo1234
asked
Nov 21, 2018
Programming in C
breadth-first-search
algorithms
graph-algorithms
+
–
0
votes
1
answer
1118
best algo to sort 1 million item
what is the best algorithm to sort a list of more than 1 million items in an array a)quicksort b) merge sort c)heap sort d) bubble sort
what is the best algorithm to sort a list of more than 1 million items in an arraya)quicksort b) merge sort c)heap sort d) bubble sort
Meenakshi Sharma
1.2k
views
Meenakshi Sharma
asked
Nov 21, 2018
Algorithms
algorithms
sorting
+
–
0
votes
0
answers
1119
What will be Final Content of Array
Na462
541
views
Na462
asked
Nov 19, 2018
Programming in C
algorithms
programming-in-c
array
+
–
–1
votes
0
answers
1120
ace book
how to find value in this type of question???
how to find value in this type of question???
CHïntän ÞäTël
804
views
CHïntän ÞäTël
asked
Nov 19, 2018
Algorithms
algorithms
time-complexity
+
–
0
votes
1
answer
1121
madeeasy
how to apply masters theorem in this type of cases!????!
how to apply masters theorem in this type of cases!????!
CHïntän ÞäTël
309
views
CHïntän ÞäTël
asked
Nov 19, 2018
Algorithms
algorithms
master-theorem
+
–
0
votes
0
answers
1122
Shortest Path
Vaishnavi01
309
views
Vaishnavi01
asked
Nov 19, 2018
Algorithms
algorithms
graph-algorithms
shortest-path
+
–
0
votes
0
answers
1123
MIT fall 2011 algorithms
Given a directed graph G, consider forming a graph G0 as follows. Each vertex u0 ∈ G0 represents a strongly connected component (SCC) of G. There is an edge (u0 , v0 ) in G0 if there is an edge in G from the SCC corresponding to u0 to the SCC corresponding ... (u0 , v0 ) in G0 if there is an edge in G from the SCC corresponding to u0 to the SCC corresponding to v0 "
Given a directed graph G, consider forming a graph G0 as follows. Each vertex u0 ∈ G0 represents a strongly connected component (SCC) of G. There is an edge (u0 , v0 ) ...
Sandy Sharma
345
views
Sandy Sharma
asked
Nov 19, 2018
Graph Theory
algorithms
graph-theory
+
–
0
votes
1
answer
1124
recurrence relation
T(n)=5 T ($\frac{n}{2}$+16) + n2 please tell the solution as i m getting confused
T(n)=5 T ($\frac{n}{2}$+16) + n2please tell the solution as i m getting confused
LavTheRawkstar
721
views
LavTheRawkstar
asked
Nov 18, 2018
Algorithms
recurrence-relation
algorithms
+
–
0
votes
2
answers
1125
METest_Algo
I think the past cost to G from A as computed by Dijkstra should be 2 instead of 8. Please help me verify it.
I think the past cost to G from A as computed by Dijkstra should be 2 instead of 8.Please help me verify it.
Ayush Upadhyaya
750
views
Ayush Upadhyaya
asked
Nov 18, 2018
Algorithms
algorithms
dijkstras-algorithm
made-easy-test-series
numerical-answers
+
–
0
votes
2
answers
1126
selfas
f(n) + O(f(n)) = Θ(f(n)) True or not? Explain please
f(n) + O(f(n)) = Θ(f(n))True or not? Explain please
Vegeta
617
views
Vegeta
asked
Nov 17, 2018
Algorithms
algorithms
asymptotic-notation
+
–
0
votes
0
answers
1127
Made Easy Algorithms Test - 2
https://gateoverflow.in/?qa=blob&qa_blobid=8164680937983732221 I don't understand the solution at all. I thought 91,33,44,and 77 can come in any possible ways but that has been said wrong.
https://gateoverflow.in/?qa=blob&qa_blobid=8164680937983732221I don't understand the solution at all. I thought 91,33,44,and 77 can come in any possible ways but that has...
Anurag Aizen Mukherj
266
views
Anurag Aizen Mukherj
asked
Nov 17, 2018
Algorithms
algorithms
hashing
+
–
0
votes
0
answers
1128
Algorithm-METest-MST
A Spanning tree T(V,E) has bottleneck edge, means all edges present in T with the greatest cost would be bottleneck edges. Now they have said, A spanning tree T of G is a minimum bottleneck spanning tree if no spanning tree T' existed with cheaper ... I think if in (A) it was minimum bottleneck spanning tree, then (B) would not have been possible to produce. Please guide.
A Spanning tree T(V,E) has bottleneck edge, means all edges present in T with the greatest cost would be bottleneck edges.Now they have said, A spanning tree T of G is a...
Ayush Upadhyaya
1.1k
views
Ayush Upadhyaya
asked
Nov 17, 2018
Algorithms
algorithms
minimum-spanning-tree
+
–
0
votes
0
answers
1129
Time Complexity
How to solve the following recurrence relation? T(n) = T(n-6) + n2 , n>7 T(n) = 1 , n<= 7
How to solve the following recurrence relation?T(n) = T(n-6) + n2 , n>7T(n) = 1 , n<= 7
garvit_vijai
477
views
garvit_vijai
asked
Nov 17, 2018
Algorithms
time-complexity
asymptotic-notation
recurrence-relation
algorithms
+
–
0
votes
0
answers
1130
TIME COMPLEXITY
n is prime ,find value of x and find time complexity. main() { x=0; for(i=1;i<=n;i++) { if(n%i) { for(j=1;j<=n;j=j*10) { x=x+1; } } } } what i am getting is x=(n-2)logn tym complexity =n+(n-2)log n. is correct ?
n is prime ,find value of x and find time complexity.main(){x=0;for(i=1;i<=n;i++){if(n%i){for(j=1;j<=n;j=j*10){x=x+1;}}}}what i am getting is x=(n-2)logntym complexity =n...
eyeamgj
327
views
eyeamgj
asked
Nov 17, 2018
Algorithms
time-complexity
algorithms
+
–
0
votes
1
answer
1131
Self Doubt - Quick Sort
Consider the following inputs: 1) 2 2 2 2 2 2 2 2) 1 2 3 4 5 6 7 3) 7 6 5 4 3 2 1 In all three cases, the worst-case time complexity of quicksort is O(n2) My doubt is if I am taking the middle element as a pivot, ... ), right? Can someone explain how we are saying worst-case time complexity for these three cases is O(n2) irrespective of the selection of the pivot element?
Consider the following inputs:1) 2 2 2 2 2 2 22) 1 2 3 4 5 6 73) 7 6 5 4 3 2 1In all three cases, the worst-case time complexity of quicksort is O(n2) My doubt is if I am...
garvit_vijai
931
views
garvit_vijai
asked
Nov 16, 2018
Algorithms
algorithms
quick-sort
time-complexity
+
–
0
votes
0
answers
1132
GATEBOOK_DSA5_7
Which of the following provides a lower bound on the number of comparisons needed to find the kth largest element in an array of n integer elements? (A) n ∗ k (B) n + k − log n (C) min (n + k − 1, 2(n − k + 1)) (D) n − 1 + min (k − 1, n − k)
Which of the following provides a lower bound on the number of comparisons needed to find the kth largest element in an array of n integer elements?(A) n ∗ k (B) n + k ...
Ayush Upadhyaya
577
views
Ayush Upadhyaya
asked
Nov 16, 2018
Programming in C
algorithms
+
–
1
votes
1
answer
1133
GATEBOOK_DSA5_6
Narendra is traveling from point A to point B and there are n toll posts along the way. Before starting the journey, Narendra is given, for each post 1 ≤ i < j ≤ n, the feeto travel from post i to post j. The goal is to minimize the travel ... The answer is given to be (C). Is it like this has been solved using Dijkstra using fibonacci heaps? Am I thinking in correct direction?
Narendra is traveling from point A to point B and there are n toll posts along the way. Before starting the journey, Narendra is given, for each post 1 ≤ i < j ≤ n, t...
Ayush Upadhyaya
313
views
Ayush Upadhyaya
asked
Nov 16, 2018
Programming in C
algorithms
+
–
0
votes
0
answers
1134
GATEBOOK_DSA4_17
If Radix sort is used to sort an array of n integers which are in the range , where d is some function of input size, the time taken would be? (A) (B) (C) (D) I know that Radix sort takes $\theta(d(n+k))$ times over 'd' digits of ... it uses takes $\theta(n+k)$ times in each pass where k represents the range of input numbers. I am unable to solve this. Please help.
If Radix sort is used to sort an array of n integers which are in the range ,where d is some function of input size, the time taken would be?(A) (B)(C) (D) I know that Ra...
Ayush Upadhyaya
139
views
Ayush Upadhyaya
asked
Nov 16, 2018
Programming in C
algorithms
+
–
2
votes
1
answer
1135
GATEBOOK_DSA4_2
In which of the cases shown below, Binary search can not always be applied for searching (A) Hierarchical data record (B) Internet Domain name conversion (C) Searching a telephone number in directory (D) An array of integers Answer is given to be (D). I thought it must be (B). Please help. I understand (D) is okay when the array is not sorted.But what about other options?
In which of the cases shown below, Binary search can not always be applied for searching(A) Hierarchical data record (B) Internet Domain name conversion (C) Searching a t...
Ayush Upadhyaya
1.1k
views
Ayush Upadhyaya
asked
Nov 15, 2018
Programming in C
algorithms
binary-search
+
–
3
votes
0
answers
1136
GATEBOOK-DSA4_8
Consider a sorted array A of n integer elements, A[0]...A[n − 1]. A search operation is to be performed on this array using .Binary search algorithm. If the element being searched is in fact the last element of the array, what is the difference between the index of element ... This is my answer.But it matches none of the options. Where I went wrong?
Consider a sorted array A of n integer elements, A[0]...A[n − 1].A search operation is to be performed on this array using .Binary search algorithm. If the element bein...
Ayush Upadhyaya
956
views
Ayush Upadhyaya
asked
Nov 15, 2018
Programming in C
data-structures
binary-search
algorithms
+
–
1
votes
1
answer
1137
Max heap when stored in an array is always in sorted order
This question is in CLRS,if we have a max heap it is always in sorted order(descending) order.And by extension if we have min heap the array is sorted in ascending order.Is this true? I have a counter example for ... it an heapified representation or not? If we heapify after deletion and store max deleted element then we get sorted array.
This question is in CLRS,if we have a max heap it is always in sorted order(descending) order.And by extension if we have min heap the array is sorted in ascending order....
sripo
2.8k
views
sripo
asked
Nov 15, 2018
DS
sorting
binary-heap
array
data-structures
algorithms
+
–
1
votes
1
answer
1138
What is the value of T(n) for the given recurrence relation
T(n)=T(n/2)+2; T(1)=1 when n is power of 2 the correct expression for T(n) is: a) 2(logn+1) b) 2logn c)logn+1 d)2logn+1
T(n)=T(n/2)+2; T(1)=1when n is power of 2 the correct expression for T(n) is:a) 2(logn+1)b) 2lognc)logn+1d)2logn+1
sripo
1.6k
views
sripo
asked
Nov 14, 2018
Algorithms
recurrence-relation
algorithms
time-complexity
jest
+
–
4
votes
0
answers
1139
GATEBOOK_DS_1_12_Asymptotic_Notations
Which of the following is the correct order if they are ordered by asymptotic growth rates? $F_1:n^{lg\,lgn}$ $F_2:(3/2)^n$ $F_3:(lg\,n)^{lg\, n}$ $F_4:n!$ $F_3$ can be re-written as $n^{lg\,lgn}$ using property $a^{log_bc}=c^{log_ba}$ So, $F_4 \gt F_2 \gt F_1=F_3$ Is my order correct?
Which of the following is the correct order if they are ordered by asymptotic growth rates?$F_1:n^{lg\,lgn}$$F_2:(3/2)^n$$F_3:(lg\,n)^{lg\, n}$$F_4:n!$$F_3$ can be re-wri...
Ayush Upadhyaya
675
views
Ayush Upadhyaya
asked
Nov 14, 2018
Algorithms
asymptotic-notation
algorithms
+
–
2
votes
0
answers
1140
Connected Components
Na462
1.5k
views
Na462
asked
Nov 14, 2018
Graph Theory
algorithms
graph-theory
graph-algorithms
+
–
Page:
« prev
1
...
33
34
35
36
37
38
39
40
41
42
43
...
118
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register