-
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks