Question
Train ‘X’ is 360 metres long and takes 18 seconds to
cross a pole. Speed of train ‘Y’ is 22 m/sec. If both trains cross each other in 16 seconds while travelling towards each other, then what is the length of train ‘Y’?Solution
ATQ,
Speed of train ‘X’ = (360/18) = 20 m/sec
So, relative speed of train ‘X’ with respect to train ‘Y’ (travelling towards each other) = 20 + 22 = 42 m/sec
Let the length of train ‘Y’ = ‘x’ metres
Distance covered by both trains together in 16 seconds = (360 + x) metres
Or, 16 × 42 = 360 + x
Or, 672 = 360 + x
Or, x = 672 – 360 = 312
So, length of train ‘Y’ = 312 metres
Python's built-in dict (dictionary) data structure is typically implemented using a hash table. What is the average-case time complexity for get, set, a...
Which CPU scheduling algorithm is known for minimizing the average waiting time for a set of processes?
How many participating entities are there in an n-ary relationship where n=5?
Which type of polymorphism in Java is achieved through method overloading?
Consider the following Python code:
def mystery(a, b):
if a == 0:
return b
e...
A software development team is implementing a sorting function for a large dataset in their project. They decide to use the quick sort algorithm to opti...
The following Python code intends to enforce that all `Worker` subclasses implement a `work` method. However, it's not working as expected.
class...
Which of the following is a challenge in machine translation?
The following C++ code has a common inheritance-related issue. How can it be debugged to ensure the derived class constructor properly initializes the b...
What is the output for the below code
MyList = ["New York", "London", "Paris", "New Delhi"] MyFile=open('output.txt','w') for element in MyLis...