Question
Train M, βxβ metres long crosses (x β 30) metres
long platform in 22 seconds while train N having the length (x + 30) metres crosses the same platform in 28 seconds. If the speeds of both trains are same then find the value of βxβ.Solution
Total distance travelled by train M = (2x β 30) m Total distance travelled by train N = (x + 30 + x β 30) = 2x m According to question, => (2x β 30)/22 = 2x/28 => 56x β 840 = 44x => 12x = 840 => x = 70 m
Which algorithm returns a minimum spanning tree (MST) and uses a priority queue to select the next edge connected to the growing tree?
What is the time complexity of searching in a balanced binary search tree?
For which problem is dynamic programming NOT generally an applicable technique because it lacks overlapping subproblems?
Which of the following algorithms is most appropriate for a sorting task that requires minimal auxiliary space?
In a binary tree, if the number of leaf nodes is L, what is the number of nodes with two children?
Which of the following is true about the time complexity of Merge Sort?
The recurrence relation T(n) = 2T(n/2) + O(n) corresponds to which algorithmβs time complexity?
The amortized time for inserting into a dynamic array (like C++ vector) is:
Which data structure is most suitable for implementing recursion?
In hashing, what is a collision?