Is my approach correct?
0 Answers
Is my approach correct?
| Flag | PURGE
Problem : There is a hill and few taps are present, all connected to other taps above/below, find which tap will be the last one to get water from a spring on the top of the mountain.
My Approach : Now I understand this is a connected graph problem. And by doing Breadth First Traversal we can get the last tap which will get the water.
Doubt : 1. Is my solution correct? If yes, then does BFT always gives the right answer? 2. Is there any other approach I'm not seeing?
Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.