Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage for Algorithms
Recent questions tagged algorithms
1
votes
2
answers
1621
CMI2017-B-6
We are given a sequence of pairs of integers $(a_1, b_1),(a_2, b_2), \dots ,(a_n, b_n)$. We would like to compute the largest $k$ such that there is a sequence of numbers $c_{i_1} \leq c_{i_2} \leq \dots \leq c_{i_k}$ ... each $j \leq k$, $c_{i_j}=a_{i_j}$ or $c_{i_j} = b_{i_j}$ . Describe an algorithm to solve this problem and explain its complexity.
We are given a sequence of pairs of integers $(a_1, b_1),(a_2, b_2), \dots ,(a_n, b_n)$. We would like to compute the largest $k$ such that there is a sequence of numbers...
Tesla!
729
views
Tesla!
asked
Feb 5, 2018
Algorithms
cmi2017
algorithms
time-complexity
descriptive
+
–
2
votes
1
answer
1622
CMI2017-B-2
There are a number of tourist spots in a city and a company GoMad runs shuttle services between them. Each shuttle plies between a designated origin and destination, and has a name. Due to lack of coordination, the same name may be allotted to multiple routes. To make matters ... are carrying a GoMad pass or a GoCrazy pass, you can start at $s$ and arrive at $t$ using the sequence $σ$.
There are a number of tourist spots in a city and a company GoMad runs shuttle services between them. Each shuttle plies between a designated origin and destination, and ...
Tesla!
426
views
Tesla!
asked
Feb 5, 2018
Algorithms
cmi2017
algorithms
algorithm-design
+
–
3
votes
2
answers
1623
CMI2017-A-10
We have constructed a polynomial time reduction from problem $A$ to problem $B$. Which of the following is a valid inference? If the best algorithm for $B$ takes exponential time, then there is no polynomial time algorithm for $A$ ... don't know whether there is a polynomial time algorithm for $B$, then there cannot be a polynomial time algorithm for $A$.
We have constructed a polynomial time reduction from problem $A$ to problem $B$. Which of the following is a valid inference?If the best algorithm for $B$ takes exponenti...
Tesla!
2.3k
views
Tesla!
asked
Feb 4, 2018
Algorithms
cmi2017
algorithms
reduction
p-np-npc-nph
+
–
7
votes
2
answers
1624
CMI2017-A-08
A $\text{stable sort}$ preserves the order of values that are equal with respect to the comparison function. We have a list of three-dimensional points $[(7, 1, 8),(3, 5, 7),(6, 1, 4),(6, 5, 9),(0, 2, 5),(9, 0, 9)].$ We sort these in ascending order by the second coordinate. Which of the following ... $[(9, 0, 9),(6, 1, 4),(7, 1, 8),(0, 2, 5),(3, 5, 7),(6, 5, 9)]$
A $\text{stable sort}$ preserves the order of values that are equal with respect to the comparison function. We have a list of three-dimensional points$[(7, 1, 8),(3, 5, ...
Tesla!
2.1k
views
Tesla!
asked
Feb 4, 2018
Algorithms
cmi2017
algorithms
sorting
+
–
1
votes
1
answer
1625
Finding max value of X in MST
I have this doubt that if the maximum value of x is to be found so that it is included in MST, then will it be 3 or 4? Because if it is 3 then there is no doubt that it would be included in the MST but if it is 4 then also it may get ... one should I consider? If the opposite was asked i.e. the minimum value of x so that it never gets included in MST then it is 5.
I have this doubt that if the maximum value of x is to be found so that it is included in MST, then will it be 3 or 4? Because if it is 3 then there is no doubt that it w...
MiNiPanda
633
views
MiNiPanda
asked
Feb 2, 2018
Algorithms
algorithms
minimum-spanning-tree
+
–
0
votes
1
answer
1626
Virtual Gate Test Series: Algorithms - Time Complexity
An array of $n$ distinct elements is said to be un-sorted if for every index $i$ such that $2 ≤ i ≤ n − 1,$ either $\{A[i] > max{A[i − 1], A[i + 1]}\},$ or $\{A[i] < min{A[i − 1], A[i + 1]}\}.$ What is the time-complexity of the fastest ... $O( \sqrt{n})$ $(C) O( \sqrt{n})$ but not $O(log n)$ $(D) O(log n)$ but not $O(1)$
An array of $n$ distinct elements is said to be un-sorted if for every index $i$ such that $2 ≤ i ≤ n − 1,$either $\{A[i] max{A[i − 1], A[i + 1]}\},$ or $\{A[i]...
Utsav09
387
views
Utsav09
asked
Jan 31, 2018
Algorithms
algorithms
time-complexity
virtual-gate-test-series
+
–
0
votes
1
answer
1627
Time complexity
#include<stdio.h> int main() { int sum =0; for(limit=1;limit<=n;limit*=2) { for(i=0;i<limit;i++) { for(j=0;j<n;j+=2) { sum+=j; } for(j=1;j<n;j*=2) { sum*=j; } } } }
#include<stdio.h int main() { int sum =0; for(limit=1;limit<=n;limit*=2) { for(i=0;i<limit;i++) { for(j=0;j<n;j+=2) { sum+=j; } for(j=1;j<n;j*=2) { sum*=j; } } } }
junaid ahmad
533
views
junaid ahmad
asked
Jan 31, 2018
Programming in C
time-complexity
algorithms
+
–
0
votes
0
answers
1628
MadeEasy Test Series: Algorithms - Time Complexity
PS : This question is similar to GATE2004-82, but different, so plz donot close it with duplicate Note, and help in answering
PS : This question is similar to GATE2004-82, but different, so plz donot close it with duplicate Note, and help in answering
Salazar
462
views
Salazar
asked
Jan 31, 2018
Algorithms
algorithms
time-complexity
made-easy-test-series
+
–
2
votes
2
answers
1629
Merge Sort
Let A,B,C,D,E are sorted sequences having length 70,74,80,85,102 respectively.They are merged into a single sequence by merging together two sequences at a time.The minimum number of comparisons that will be needed by algorithm in best case for going merging is _________.
Let A,B,C,D,E are sorted sequences having length 70,74,80,85,102 respectively.They are merged into a single sequence by merging together two sequences at a time.The minim...
VS
4.3k
views
VS
asked
Jan 30, 2018
Algorithms
merge-sort
algorithms
numerical-answers
+
–
0
votes
1
answer
1630
me test
Let $f (n) = Ο(n), g(n) = \Omega(n)$ and $h(n) = \theta(n)$. Then $g(n) + f(n).h(n)$ is ______ How to solve such examples. Rules for math of asymptotic notations(mul,div,add,sub of diif notations)
Let $f (n) = Ο(n), g(n) = \Omega(n)$ and $h(n) = \theta(n)$. Then $g(n) + f(n).h(n)$ is ______How to solve such examples.Rules for math of asymptotic notations(mul,div,a...
ankit_thawal
249
views
ankit_thawal
asked
Jan 30, 2018
Algorithms
algorithms
asymptotic-notation
made-easy-test-series
+
–
1
votes
1
answer
1631
me test series
how the tc is O(n^4)
how the tc is O(n^4)
eyeamgj
286
views
eyeamgj
asked
Jan 30, 2018
Algorithms
made-easy-test-series
algorithms
time-complexity
+
–
2
votes
1
answer
1632
Equivalent Complexity
Given f(n) = ω(n2). Which of the following can never hold? a. f(n) = O (n3) b. f(n) = Ω (n2) c. f(n) = θ (n2) d. f(n) = ω (n)
Given f(n) = ω(n2).Which of the following can never hold?a. f(n) = O (n3)b. f(n) = Ω (n2)c. f(n) = θ (n2)d. f(n) = ω (n)
Tuhin Dutta
740
views
Tuhin Dutta
asked
Jan 30, 2018
Algorithms
algorithms
asymptotic-notation
time-complexity
+
–
2
votes
1
answer
1633
MadeEasy Test Series 2018: Algorithms - Dynamic Programming
The number of balance parenthesis possible with 5-pairs of parenthesis _________. [ Assume ( ) and (( )) is balance parenthesis but not ) ( ]
The number of balance parenthesis possible with 5-pairs of parenthesis _________. [ Assume ( ) and (( )) is balance parenthesis but not ) ( ]
Sumaiya23
2.1k
views
Sumaiya23
asked
Jan 29, 2018
Algorithms
algorithms
dynamic-programming
counting
made-easy-test-series
+
–
1
votes
1
answer
1634
MadeEasy Full Length Test 2018: Algorithms - Time Complexity
Sabrina Kaur Dhalla
463
views
Sabrina Kaur Dhalla
asked
Jan 28, 2018
Algorithms
algorithms
time-complexity
made-easy-test-series
numerical-answers
+
–
1
votes
1
answer
1635
MadeEasy Test Series 2018: Algorithms - Dynamic Programming
sumit chakraborty
838
views
sumit chakraborty
asked
Jan 28, 2018
Programming in C
algorithms
dynamic-programming
made-easy-test-series
+
–
3
votes
1
answer
1636
#distinct MSTs
......................................................
......................................................
Tuhin Dutta
632
views
Tuhin Dutta
asked
Jan 28, 2018
Algorithms
algorithms
minimum-spanning-tree
numerical-answers
test-series
+
–
2
votes
0
answers
1637
MadeEasy Test Series 2018: Algorithms - Time Complexity
i got O(nlogn). is it right?
i got O(nlogn). is it right?
Sukhdip Singh
393
views
Sukhdip Singh
asked
Jan 28, 2018
Algorithms
algorithms
time-complexity
made-easy-test-series
+
–
1
votes
0
answers
1638
Gate_2018_Mock_Test
is there is any short cut ? I am using prism algoritham ...its tak too much time
is there is any short cut ? I am using prism algoritham ...its tak too much time
Harikesh Kumar
181
views
Harikesh Kumar
asked
Jan 27, 2018
Algorithms
algorithms
+
–
1
votes
0
answers
1639
Huffman Coding
Which of the following statements is/are correct? P:In Huffman Coding, the item with the second lowest probability is always at the leaf that is furthest from the root Q: In Huffman Coding, the item with the highest probability is always at the leaf that is closest to the ... leaf that is the child of the root Edit :Answer is P and Q R is not always true and always word i missed :(
Which of the following statements is/are correct?P:In Huffman Coding, the item with the second lowest probability is always at the leaf that is furthest from the rootQ: I...
sunil sarode
1.6k
views
sunil sarode
asked
Jan 27, 2018
Algorithms
huffman-code
algorithms
+
–
6
votes
1
answer
1640
Back edge,tree edge,forward edges in BFS
Consider the following statements: 1. Let T be the DFS tree resulting from DFS traversal on a connected directed graph the root of the tree is an articulation point, iff it has at least two children. 2. When BFS is carried out on a directed ... back edge, or cross edge and not forward edge as in the case of DFS. Find TRUE or FALSE for both the statements
Consider the following statements:1. Let T be the DFS tree resulting from DFS traversal on a connected directed graph the root of the tree is an articulation point, iff i...
MIRIYALA JEEVAN KUMA
13.4k
views
MIRIYALA JEEVAN KUMA
asked
Jan 27, 2018
DS
algorithms
breadth-first-search
depth-first-search
graph-algorithms
programming-in-c
data-structures
+
–
1
votes
1
answer
1641
Gate_2018_Model Paper
Please explain the solution
Please explain the solution
Harikesh Kumar
483
views
Harikesh Kumar
asked
Jan 27, 2018
Programming in C
data-structures
algorithms
+
–
2
votes
1
answer
1642
Algorithms:Asymptotic Notations
plz help me . how to solve that type of question
plz help me . how to solve that type of question
92komal
396
views
92komal
asked
Jan 26, 2018
Algorithms
algorithms
asymptotic-notation
test-series
+
–
7
votes
2
answers
1643
True/False
Which of the following statements related to graphs are True? Minimum Spanning Tree has ALWAYS Minimum weight edge included in it. Minimum Spanning Tree MIGHT have Maximum weight edge weight included in it. Maximum Spanning Tree has ALWAYS Maximum weight edge included ... edge included in it. Longest path from source to destination MAY OR MAY NOT have Maximum weight edge included in it.
Which of the following statements related to graphs are True?Minimum Spanning Tree has ALWAYS Minimum weight edge included in it.Minimum Spanning Tree MIGHT have Maximum ...
Balaji Jegan
2.1k
views
Balaji Jegan
asked
Jan 26, 2018
Graph Theory
graph-theory
graph-algorithms
algorithms
+
–
3
votes
1
answer
1644
please solve this Q
kallu singh
296
views
kallu singh
asked
Jan 26, 2018
Algorithms
algorithms
recurrence-relation
made-easy-test-series
+
–
2
votes
1
answer
1645
MadeEasy Test Series 2018: Algorithms - Reccurence
Kindly help in solving the following recurrence relation. Solution is given by using Master's Theorem but can it be applied when the parameter 'b' is not an integer? IF not, then how to solve it? options are O(n), O(n^2), O(nlogn), O(n^2 logn)
Kindly help in solving the following recurrence relation. Solution is given by using Master's Theorem but can it be applied when the parameter 'b' is not an integer?IF no...
Subham Nagar
387
views
Subham Nagar
asked
Jan 26, 2018
Algorithms
algorithms
recurrence-relation
made-easy-test-series
+
–
3
votes
1
answer
1646
From Geeksforgeeks
Given A, an array of size n, comprised of an increasing sequence of numbers followed immediately by a decreasing one. What is worst case time complexity of optimal algorithm to determine if a given number x is in the array?
Given A, an array of size n, comprised of an increasing sequence of numbers followed immediately by a decreasing one. What is worst case time complexity of optimal algori...
Abhishek Malik
2.4k
views
Abhishek Malik
asked
Jan 25, 2018
Algorithms
algorithms
time-complexity
array
+
–
0
votes
0
answers
1647
MadeEasy Test Series 2018: Algorithms - Reccurence
how to solve these type of ques?
how to solve these type of ques?
Sukhdip Singh
319
views
Sukhdip Singh
asked
Jan 25, 2018
Algorithms
algorithms
recurrence-relation
made-easy-test-series
+
–
1
votes
3
answers
1648
Dijkstra Algorithm
I think answer should be Option(B). Path:<s,y><y,x><x,t> = 7-3-2=2
I think answer should be Option(B).Path:<s,y><y,x><x,t = 7-3-2=2
ankit_thawal
1.6k
views
ankit_thawal
asked
Jan 25, 2018
Algorithms
dijkstras-algorithm
shortest-path
algorithms
made-easy-test-series
+
–
1
votes
2
answers
1649
Worst Case Time Complexity
What is the worst case time complexity to find kth smallest element into an array of ‘n’ element?
What is the worst case time complexity to find kth smallest element into an array of ‘n’ element?
vishal chugh
1.8k
views
vishal chugh
asked
Jan 24, 2018
DS
algorithms
time-complexity
data-structures
sorting
+
–
1
votes
1
answer
1650
Algorithms
A sorting algorithm is stable if duplicate elements remain in the same relative position after sorting. What is the meaning of this statement
A sorting algorithm is stable if duplicate elements remain in the same relative position after sorting.What is the meaning of this statement
gauravkc
224
views
gauravkc
asked
Jan 24, 2018
Algorithms
algorithms
sorting
+
–
Page:
« prev
1
...
50
51
52
53
54
55
56
57
58
59
60
...
118
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register