Question
A train started from station P and preceded towards
station Q at a speed of 80 km/h. 45 minutes later, another train started from station Q and preceded towards station P at 100 km/h. If the distance between the two stations is 420 km, at what distance from station P will the trains meet?Solution
Let the train will meet ‘t’ hours after the train from station Q started Distance travelled by train started from station P = 80 x 45/60 km Distance travelled by train started from station Q = (80 + 100) x t km Total distance between station P and Q = 420 km Now, 80 x (45/60) + (80 + 100) x t = 420 ⇒ 60 + 180t = 420 ⇒ 180t = 420 – 60 = 360 ⇒ t = 360/180 = 2 hours Distance travelled by train starting from station P at all meeting point = 60 + 80 x 2 = 220 km
Which algorithm is used for computing Max-Flow in a network?
Given the following code snippet, which operation is performed on the binary tree to produce the output: 4, 2, 5, 1, 3 ?
class Node {Â Â Â Â Â in...Which data structure is most suitable for implementing a priority queue with logarithmic time complexity for insertion and deletion?
Tarjan’s algorithm is used to find:
In C++, which access specifier makes members accessible only from within the class itself and from friend functions/classes?
What is the worst-case time complexity for inserting an element into a hash table that uses separate chaining for collision resolution?
In a graph, what is the maximum number of edges in a simple undirected graph with 'n' vertices?
Time complexity of heap sort is:
Which of the following is true about triggers in a relational database?
What is the primary purpose of an abstract class?