Search:

Type: Posts; User: VallisMar

Search: Search took 0.10 seconds.

  1. Replies
    9
    Views
    844

    Re: N-Queen using Stack

    Your questions made me go back and re-check over and over till I figured it out. I ended one of the loops to test if the board size is equal to getCol(), then return; and worked!
    Thank you for...
  2. Replies
    9
    Views
    844

    Re: N-Queen using Stack

    I rechecked, that does not have to be there. I deleted that chunk of code, still same issue.
    It is supposed to check until no further solutions are found, then exit, not start all over.
  3. Replies
    9
    Views
    844

    Re: N-Queen using Stack

    Thank you for responding by the way!
    I added print statements throughout the method. Right after the r--;//This is making it loop infinitely, before temp=board.pop(); print statement is in the...
  4. Replies
    9
    Views
    844

    Re: N-Queen using Stack

    sorry about the messy code!
    It's supposed to exit once it it finds all the solutions for the board size (bSize), which is called in the main method.
    For example, if we give the board a size of 4,...
  5. Replies
    9
    Views
    844

    N-Queen using Stack

    Hello everyone,
    New here. I am working on the N-Queen program and encountered a problem. The method below works and produces solutions, but it runs infinitely! Can someone take a look and see if...
Results 1 to 5 of 5