Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

Find Appropriate Algorithm

$
0
0

We have some cars and we select some cars from them. Then there are some exit doors. How can I find out that the selected cars are nearest to the exit door? We know each car distance to exit door.

For example, we have 25 cars and we select 5 cars from them. We have 2 exit doors. How can I find out that these 5 cars are nearest to exit door? If not, which car needs to be replaced.

public class ExitDoor
{
    public double ExitDoorAx; //we work with point and it have x and y
    public double ExitDoorAy;
}
public class Car
{ 
    public double CarLocationAx; 
    public double CarLocationAy;   
}


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>