How to implement a stack using two queues!

Reply

Join Date: Oct 2004
Posts: 2
Reputation: whatsgoin'on is an unknown quantity at this point 
Solved Threads: 0
whatsgoin'on's Avatar
whatsgoin'on whatsgoin'on is offline Offline
Newbie Poster

How to implement a stack using two queues!

 
0
  #1
Oct 26th, 2004
could anyone describe to me how to implement a stack using two queues. just cant get my head round it.thanks to anyone who helps.
You'll have to speak up- I'm wearing a towel!
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,622
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 713
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: How to implement a stack using two queues!

 
0
  #2
Oct 26th, 2004
It takes about five minutes to figure out. Just take a few coins and use queue-like operations to simulate the pushing and popping of a stack. The nice thing about stacks and queues is that the concepts are so simple you can easily diagram them with minimal effort.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC