Solution for the problem is provided below, please comment if any doubts:
Answer:
Explanation:
The given problem is to find the number of roots between lower left corner and the upper right corner node.
Each side has “n” nodes thus each side has “n-1” edges.
Thus the shortest distance between the given source and destination is “2*(n-1)”.
Now to reach from lower left to upper right, we need to follow two directions, either right or up, it is clear that we need to take “n-1” right steps and “n-1” up steps.
Now in the “2*(n-1)” length paths there should be “n-1” right and “n-1” up moves.
The number of possible combination of such nodes is:
Get Answers For Free
Most questions answered within 1 hours.