Problem :

A person wants to travel from one point to another where A is the source point and D is the destination point. The inputs to the problem consisted of paths to be traversed while traversing from source to destination as follows :

B-->C

A-->B

C-->D

( The input paths are to be considered in these orders only)

The aim is to give correct sequence of paths which is as follows :

A-->B

B-->C

C-->D

The interviewer gave hint that in the correct sequence of paths ( A-->B , B-->C , C-->D ), the end point of the 1st path is the start point of the 2nd path and the end point of the 2nd path is the start point of the 3rd path. To achieve this correct sequence we have to use data structures like multi-dimensional array.

This post has been edited by **macosxnerd101**: 17 July 2015 - 01:26 PM

Reason for edit:: Renamed title to be more descriptive