Results 1 to 6 of 6

Thread: n queens problem

  1. #1

    n queens problem

    can anyone please help me to solve the n queens problem using stacks
    i could do it using recursion.
    please help me out
    that is my project
    i hope i get the required help
    but the code should be entirely in c++

  2. #2
    Join Date
    Sep 2006
    4,059 could just do the work yourself, and then you learn what you're supposed to!!!!

  3. #3
    MadDoctor Club Spammy's Avatar
    Join Date
    Dec 2000
    MadDoctors Wool.
    Dude I have no idea what you just said.
    Wish I could help however, no idea what you are saying.
    - Reps for being a smartass.
    SG Sh!!t List

    Bouncer, downhill, John, Kip Patterson, Roody, YeOldeStonecat, Ken, Philip, David, Indy, Noevo.

  4. #4
    R.I.P. 2018-07-16 RoundEye's Avatar
    Join Date
    Jul 2000
    In a dry but moldy New Orleans, Louisiana
    I really wish I could help, but magic 8 ball says outlook not so good.

    Sliding down the banister of life ..........................

  5. #5
    n queens problem is my project topic
    in this i need to write a program in c++, in such a way that th euser needs to enter the size of the chessboard(say n*n) and the program should arrange n queens on the n*n chessboard in such a way that no two queens can attack each other. the chessboard should be accepted as a double dimensional array and then we need to use stacks to push the correct positions into th estack and then pop the wrong positons ou tof it.
    i thought all of u would know the meaning of n queens problem
    anyway i hope i receive th required help

  6. #6
    Forum Techie A_old's Avatar
    Join Date
    Jan 2000
    Define "Required Help," please. Do some research on the problem, derive an algorithm of some sort (I'm not sure why one would use a stack since the "correct" positions depend on what has already been chosen as "correct;" although dynamic programming is certainly a useful way to go about thinking about it). No one will give you the answer to your homework.

    If you go around to 18 forums, register and post the problem and some dim whit actually gives you the answer and your teacher fails to catch you in your lie, you'll be punished later on an exam because you'll have no clue how to think critically. Furthermore, if you cheat your way through college, you'll have a hard time finding a decent job since employers will quickly realize your incompetence. I'm willing to help you figure out an algorithm, but there's not a snow flake's chance in hell I'm giving you any code.

    Edit: It's pretty simple really, find a way to place queens such that no two share the same diagonal, horizontal or vertical row.
    Last edited by A_old; 08-16-07 at 09:02 PM.

Similar Threads

  1. Atheros (problem)
    By kdeo in forum Wireless Networks & Routers
    Replies: 8
    Last Post: 04-18-08, 01:56 AM
  2. My Thinkpad T60 problem - random shutdown?
    By sogood in forum Hardware & Overclocking
    Replies: 12
    Last Post: 03-29-08, 08:25 PM
  3. DSL/Router Disconnecting Problem?
    By Pimpinc333 in forum General Broadband Forum
    Replies: 1
    Last Post: 09-24-07, 01:39 AM
  4. Some VERY VERY weird problem
    By JOHNiE in forum Networking Forum
    Replies: 9
    Last Post: 02-21-05, 09:49 PM
  5. Netgear WGT624v2 MTU Problem With PPPoE
    By patinsj in forum Broadband Tweaks Help
    Replies: 1
    Last Post: 02-19-05, 12:21 PM


Posting Permissions

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