Question
X can do a piece of work in 30 days. He worked at it for
5 days and then Y finished it in 20 days. In how many days can X and Y together finish the work?Solution
X’s five day work = 5/30 = 1/6 Remaining work = 1 – 1/6 = 5/6 This work was done by Y in 20 days. Y does 5/6th of the work in 20 days, he will finish the work in 20 × 6/5 = 24 days. X & Y together would take 1/24 + 1/24 = 2/24 = 1/12 i.e. 12 days to complete the work.
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?