Author |
Topic: find the station between starting station to dest (Read 958 times) |
|
ipl006
Newbie
Posts: 1
|
|
find the station between starting station to dest
« on: Aug 29th, 2011, 5:01am » |
Quote Modify
|
There are n stations numbered from 1 to n stored in an array the distance between any two stations is given as:: D[i][j]=0, if no path exists between the stations i and j D[i][j]=n , if the distance between two stations i and j is given to be n D[i][j]=-1 , if there is no station between i and j The stations are arranged in a ordered linear sequence , like S1,S2,S3......Sn find the station between starting station to destination station.
|
|
IP Logged |
|
|
|
Grimbal
wu::riddles Moderator Uberpuzzler
Gender:
Posts: 7527
|
|
Re: find the station between starting station to d
« Reply #1 on: Aug 29th, 2011, 5:52am » |
Quote Modify
|
I don't really understand what is being asked: Are we speaking about stations like train or bus stations? "D[i][j]=0, if no path exists between the stations i and j" Does it mean there is no direct line from i to j, or no path in the graph? "D[i][j]=-1 , if there is no station between i and j" Does it mean there is a direct line without intermediate station? Or there is no path in the sense of a disconnected graph? "The stations are arranged in a ordered linear sequence , like S1,S2,S3......Sn find the station between starting station to destination station." Are start and destination arbitrary stations? Or S1 and Sn? Do you want the shortest path? Do you want to go thru all stations?
|
|
IP Logged |
|
|
|
|