CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Minimum Queens

  1. #1
    Join Date
    Oct 2011
    Posts
    3

    Minimum Queens

    I'm trying to develop a program that gives a solution, if possible, for placing the minimum k queens on a chess board with n rows and n columns, where k < n, in such a way that some
    queen attacks each cell using a stack. I know that I can't use recursion on this problem, but otherwise, I have no idea what to do. Any help would be much appreciated.

  2. #2
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    Re: Minimum Queens

    Are you trying to develop a brute force approach or do you have a strategy you can use?
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

  3. #3
    Join Date
    Oct 2011
    Posts
    3

    Re: Minimum Queens

    I'm thinking a backtracking method, but I'm not quite sure if that's the best method for this problem.

  4. #4
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    Re: Minimum Queens

    If you want to discuss algorithms then you really need the algorithms & data structures forum.

    Once you have the algorithm, if you need help implementing it ask here.
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured