Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
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. -
mariamh03y@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
-
@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.
Can anyone help me in my task
(Solve n queens problem by stack using linked list) Data structure c++🙏
question