Menu

[Solved] C Programming Language Full Solution Please Winter Municipal Snowplows Must Plow Sides Cit Q37265256

IN C++ PROGRAMMING LANGUAGE, FULL SOLUTIONPLEASE!

In the winter, municipal snowplows must plow both sides of citystreets that are bidirectional (two-way traffic) but they only makea single pass over unidirectional (one-way) streets. We canrepresent city streets as the edges in a graph using nodes forintersections. Of course, it is a requirement that every street beplowed appropriately (once in each direction for bidirectionalstreets and only once in the proper direction for unidirectionalstreets).

Write a program that uses integers to represent nodes, andtuples (pairs of integers enclosed in parentheses, e.g., (4, 7), torepresent a street from node 4 to node 7, and a second tuple, (7 4)to represent the fact that this is a bidirectional street). Assumethat there is but a single snowplow and it must start and return tonode 1. Your program must read a collection of tuples from a fileand then produce driving instructions for the snowplow operatortelling the sequence of intersections (nodes to visit so that allthe streets are appropriately plowed. If it is impossible toperform a correct plowing (some street would be left unplowed orsome street would be plowed twice) your program must report thisfact. Your program should repeatedly read collections of tuples andprocesses the information until an end-of-file is encountered. Yourprogram will lose a significant number of points if your algorithmfails to work properly for cities (graphs) containing bothbidirectional and unidirectional streets. Your solution mustinclude the data file that it uses for input. Remember NOT to usean absolute path to access the data file – use a relative path. Becertain your data describes several different city streetsituations so that your program can demonstrate that it meets allthe requirements.

Expert Answer


Answer to IN C++ PROGRAMMING LANGUAGE, FULL SOLUTION PLEASE! In the winter, municipal snowplows must plow both sides of city stree… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *