Question
What is the time complexity of the Floyd-Warshall
algorithm for a graph with V vertices?Solution
The Floyd-Warshall algorithm has a time complexity of O(V³), where V is the number of vertices in the graph. This cubic complexity arises from its three nested loops, each iterating up to V times, which systematically update the shortest path distances.
‘X’ and ‘Y’ can do a task together in 15 days. If ‘X’ alone takes 25 days to complete it, then how much time will ‘Y’ take to finish the...
A and B can complete a work together in 25 days. If A alone can complete one-fourth of the work in ‘x’ days and remaining work is completed ...
Pooja is twice as efficient as Nita and four times as efficient as Kavya. If Nita takes 30 days to finish some work, then find the time taken by Pooja a...
Workers A and B can finish a task in 30 days when working together. They worked for 18 days, and then C completed the rest of the task alone in 12 days....
There is enough food in a camp to last for 30 days if each of the 100 soldiers present at the camp eat 3 times a day. After 20 days, 50 soldiers left t...
A company hires workers A, B, and C to finish a project. A can complete the project in 30 days, B can do it in 24 days, and C can complete it in 20 days...
Efficiency of A is 25% more than B and B takes 30 days to complete a piece of work. A started the work alone and then B joined him 4 days before actual ...
Rahul alone can do 60% of the same piece of work in (z-4) days. Queen and Rahul together can do 75% of the same piece of work in (0.5z+4) days. Pankaj a...
A buffalo alone can plough field ‘A’ in 10 days. A Bull alone can plough the field ‘A’ in 16 days. Find the number of days taken by 1 bulls and ...
A can do a work in 30 hours while B can do it in 20 hours. If C is 60% more efficient than A and B together, then find the time taken by C alone to comp...