jproboy
BAN USER
Comments (7)
Reputation 20
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
Let's consider the distance from (0,0) ->vertical-> (0,1) , (0,0) ->horizontal-> (1,0), (0,0)->diagonal->(1,1) as one step. Then the cost of moving along diagonal is 1.1*step, moving thought vertical and horizontal will cost 1*step+1*step = 2*step > 1.1*step. So we always choose diagonal as long as possible. the cost for longest diagonal will be 1.1* MIN(|A-C|, |B-D|). and left MAX(|A-C|, |B-D|) - MIN(|A-C|,|B-D|) step for horizontal or vertical which cost 1 for each step.
- jproboy July 22, 2011Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
what is M and N....?
- jproboy July 23, 2011