A valid path from A to J - Question 2

Posted by Naimishforu under Interview Questions on 2/10/2011 | Points: 10 | Views : 1444 | Status : [Member] [MVP] | Replies : 4
Hi,

This is Part 2

Recently I had been interviewed internationally!!!!! It would be very much helpful if you can also try to solve this "things".

Please first examine the below image:

http://www.uploadforever.net/download.php?img=575

Figure 1 shows a set of nodes that are labeled from A to J. The position of each node can be defined by the x, y coordinate system. The dotted segments joining the nodes A, B, E, F, I and J, shows a possible path from A to J through the nodes B, E, F and I.

2. A valid path from A to J is a path which passes through at least two nodes or is made up of at least three segments. Considering the fact that you can only move further to the right when traversing the nodes, that is, x-coordinate of the current node must always be greater than the x-coordinate of the previous node, using the classes that you have defined, write an algorithm which will list all the possible valid paths from A to J in an array.

If anyone can answer this please:

Thanks

Thanks,
Naimish
http://dotnetinterview.zxq.net/
http://naimishpandya.blogspot.in/



Responses

Posted by: jayanthichebrolupanoramicworldbiz-8895 on: 2/11/2011 [Member] Starter | Points: 25

Up
0
Down
Unable to find image link given by you.

Naimishforu, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Madhu.b.rokkam on: 2/14/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Can you please upload the image again correctly ??

Thanks and Regards
Madhu

Naimishforu, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naimishforu on: 2/14/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Ya sure...Please give me some time, I'm busy with some work..ll surely upload it as soon as possible :)

Thanks

Thanks,
Naimish
http://dotnetinterview.zxq.net/
http://naimishpandya.blogspot.in/

Naimishforu, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naimishforu on: 2/14/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Hi,

Image Updated.

Thanks :)

Thanks,
Naimish
http://dotnetinterview.zxq.net/
http://naimishpandya.blogspot.in/

Naimishforu, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response