Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Java (https://www.askmehelpdesk.com/forumdisplay.php?f=440)
-   -   Hello Java (https://www.askmehelpdesk.com/showthread.php?t=752563)

  • Jun 7, 2013, 02:07 AM
    anu12393
    Hello Java
    Create a function FindWeightedPath() which wi l l take an ar ray of str ings as input. The structure of the ar ray wi l l be as fol lows: The first
    element in the ar ray wi l l be the number of nodes N (points) in the ar ray as a str ing. The next N elements wi l l be the nodes which can be
    anything (A, B, C. . Street A, Street B. . etc.). Then after the Nth element, the rest of the elements in the ar ray wi l l be the connections
    between al l of the nodes along with their weights (integers) separated by the pipe symbol (| ). They wi l l look l ike this: (A| B| 3, B| C| 12. .
    Street A| Street B| 14. . etc.). Although, there may exist no connections at al l .
    Your function should return the shor test path when the weights are added up from node to node from the first Node to the last Node in the
    ar ray separated by dashes. The output for this ar ray should look l ike A-B-C-D-F-G. There wi l l only ever be one shor test path for the ar ray.
    If no path between the first and last node exists, return -1. The ar ray wi l l at minimum have two nodes. Also, the connection A-B for
    example, means that A can get to B and B can get to A.
  • Jun 7, 2013, 02:11 AM
    Curlyben
    What do YOU think ?
    While we're happy to HELP we won't do all the work for you.
    Show us what you have done and where you are having problems..

  • All times are GMT -7. The time now is 02:02 AM.