Hi could you help me ?
how to implement 2 stacks with a queue in data structurs ?

Recommended Answers

All 3 Replies

Welcome to the forum, Str91! ;)

The way programming forums work is, you get the ball rolling on the assignment, and then come back when you can describe a particular problem - preferably by posting code and asking specific questions about whatever is the problem.

That saves us a boatload of time in helping, and it keeps the forum from being inundated by students wanting their homework done, with minimal effort (not saying you are doing that, just that it's human nature to want to).

I suggest taking some coins, on your counter/desk top, and stacking them into the physical queue and stacks you are working with, and note the pattern that you make as you move the coins from the queue, into the two stacks. Forget about the data structure part of it, for now.

After you REALLY have the queue --> two stacks part sorted out, then start your program. [steps on soapbox]:

In woodworking, they say "Measure twice and cut once". In programming it's "Study & plan, then you can"**. If you do not know every small detail to solve a problem, then you can't teach the computer to solve it.

OK, they don't say it, but they say what it conveys, and SHOULD say it. ;)

In programming it's "Study & plan, then you can"**.

That sounds goofy. How about "Get your shit together at design time rather than coding time". :D

An odiferous reminder ===> perfect! ;)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.