[algogeeks] Re: chessboard problem

2007-05-21 Thread James
Re-send: The correct answer is Sum of C(2n-i,n)*C(n,i) over 0<=i<=n 1: 3 2: 13 3: 63 4: 321 5: 1683 6: 8989 7: 48639 8: 265729 9: 1462563 10: 8097453 On May 8, 3:59 am, PopUp <[EMAIL PROTECTED]> wrote: > Hi, > Consider the chess as a two dimensional array. How will I find the > number of ways i

[algogeeks] Re: chessboard problem

2007-05-10 Thread [EMAIL PROTECTED]
I wrote the below code and tested with n =2 and n=3. The idea is given a position (i,j) queen has three possibilities (i,j +1),(i+1,,j+1) (i+1,,j) (Off Course not always since bounds needs to be checked) int numOfPath = 0; int n = 3; void FollowPath(int i,int j) { if (i >= n || j >=n) {

[algogeeks] Re: chessboard problem

2007-05-09 Thread PopUp
Hi, Can someone explain in terms of pseudocode and algorithm? Thanks On May 9, 11:43 am, "Phanisekhar B V" <[EMAIL PROTECTED]> wrote: > Basically assume the three steps to be l (left), d (diagonal), u(up). U cant > have down and right. > > Now assume its a 3X3 board. > Then u have (a single d r

[algogeeks] Re: chessboard problem

2007-05-08 Thread Phanisekhar B V
Basically assume the three steps to be l (left), d (diagonal), u(up). U cant have down and right. Now assume its a 3X3 board. Then u have (a single d replaces one u and one l) uuulll, uudll, uddl, ddd. The total number of permutaions of all the above will give u the result. The same impl

[algogeeks] Re: chessboard problem

2007-05-08 Thread Phanisekhar B V
Sorry that not for queen On 5/9/07, Phanisekhar B V <[EMAIL PROTECTED]> wrote: > > Oops, (2n)!/((n!)^2) > > On 5/9/07, Phanisekhar B V <[EMAIL PROTECTED]> wrote: > > > > (2n)!/(n!*2) > > > > > > On 5/8/07, PopUp < [EMAIL PROTECTED] > wrote: > > > > > > > > > Hi, > > > Consider the chess as a two d

[algogeeks] Re: chessboard problem

2007-05-08 Thread Phanisekhar B V
Oops, (2n)!/((n!)^2) On 5/9/07, Phanisekhar B V <[EMAIL PROTECTED]> wrote: > > (2n)!/(n!*2) > > > On 5/8/07, PopUp <[EMAIL PROTECTED] > wrote: > > > > > > Hi, > > Consider the chess as a two dimensional array. How will I find the > > number of ways in which queen can reach (n,n) from (0,0). Only >

[algogeeks] Re: chessboard problem

2007-05-08 Thread Phanisekhar B V
(2n)!/(n!*2) On 5/8/07, PopUp <[EMAIL PROTECTED]> wrote: > > > Hi, > Consider the chess as a two dimensional array. How will I find the > number of ways in which queen can reach (n,n) from (0,0). Only > up,down,diagonal moves are allowed(obviously no back moves). > > PopUp > > > > > --~--~--