-
n-queen problem
haw to disvolve n-queen problem in c++ using stack
-
Re: n-queen problem
write it iteratively. place a queen at random, and cross off the squares that
are now illegal(bool flags). repeat until all are placed. If cannot place
them all, start over with new random location that was not used in last attempt.
This is not the best method, but a modern machine can do it by brute force
in short order, and the best solutions are all over the net, ...
"jack" <yangj36@yahoo.com> wrote:
>
>haw to disvolve n-queen problem in c++ using stack
-
Re: n-queen problem
Sorry. Use a stack where? anywhere? Missed that on first reading.
"jonnin" <jonnin@vol.com> wrote:
>
>write it iteratively. place a queen at random, and cross off the squares
that
>are now illegal(bool flags). repeat until all are placed. If cannot place
>them all, start over with new random location that was not used in last
attempt.
> This is not the best method, but a modern machine can do it by brute force
>in short order, and the best solutions are all over the net, ...
>
>
>
>
>"jack" <yangj36@yahoo.com> wrote:
>>
>>haw to disvolve n-queen problem in c++ using stack
>
-
Re: n-queen problem
You could use backtracking (yeah, I know it's not the best method). I've
got the sources in Pascal. If you want, I can send them to you.
jack <yangj36@yahoo.com> wrote in message news:3a6d1083$1@news.devx.com...
>
> haw to disvolve n-queen problem in c++ using stack
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|