Explore BrainMass
Share

Explore BrainMass

    Java program to find a path between two points in a grid

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    Based on the queue data structure and operations, write a Java program that allows to find a path from the start pin to the end pin for the grid shown in the attachment. Your program should print the path.

    © BrainMass Inc. brainmass.com October 10, 2019, 7:03 am ad1c9bdddf
    https://brainmass.com/computer-science/data-structures/java-program-path-between-two-points-grid-566291

    Attachments

    Solution Preview

    Java compiler and Java version 1.7.0_21 were used during development and testing of the attached program 566291-Grid.java . Please renamed 566291-Grid.java as Grid.java before you compile and execute the program.

    Here is how you can compile and run the program at ...

    Solution Summary

    The response includes instructions on how to compile and execute the attached Java program on commandline. It prints the path (if any exists) between start and finish pins as a string of grid location coordinates separated by arrows. It provides two variants of the solution - one that prints the path as "->" separated (x,y) pairs, and another that depicts the path in a character grid layout.

    $2.19