1
mariamh
2y

Can anyone help me in my task
(Solve n queens problem by stack using linked list) Data structure c++🙏

Comments
  • 7
    Do your homework yourself, you lazy sucker!
  • 0
    @Fast-Nop I tried to do it but I can't I am still beginner and this task is hard for me
  • 3
    @Fast-Nop grumpy grandpa was summoned 😂
  • 0
    @Frederick don’t see any upvotes 😏
  • 0
    Nevermind
  • 1
    If you want to learn the topic, then stop asking others to do your work for you and go try and try again until you figure it out.

    If you don't want to learn the topic, then go pay someone to do your work for you, instead of expecting strangers on the internet to do it for free.
  • 0
    @NotJeckel first of all thank u . +Who said that I didn't try to solve it!! I am searching for maybe week for that simple task and watching videos and searching on Google to try to get it but I couldn't understand how to use stack in it. I have been working so hard before I ask anyone to help me and I reached my limit and I don't want the solution I need someone to explain it for me step by step to get it cause I can't understand it+I am still beginner and I used to help anyone who needs me in any topic so I really didn't know that people all around me are different. U shouldn't judge me as long as u didn't see what did I do before I ask for help
  • 1
    @mariamh One hint: usually, you would solve this via a recursive function that takes the current queen number and the board, that's the obvious way. That would have an implicit stack, namely the function calling stack.

    However, remember that every recursion has an iterative equivalent, that's the key here.

    So what you have to do instead is managing that kind of stack manually, and as per the assignment, first implement a stack (ab)using a linked list where you only add/remove at the tail.

    Not that you'd ever solve the problem this way, but the point of the assignment is that you show understanding of what has been taught previously in the course. The other point is to weed out those who have only been muddling through so far.
  • 0
    @Fast-Nop thank you
Add Comment