473,513 Members | 2,490 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

implementation of stack using queuqe

1 New Member
How to implement a stack using queuqe
Mar 19 '10 #1
2 1762
jkmyoung
2,057 Recognized Expert Top Contributor
In general, it's a pretty bad idea.
There's a couple avenues you could take. Did you want to use a double queue option to implement the stack?

Or are you talking Singly Linked List? That would make a lot more sense.
Mar 19 '10 #2
donbock
2,426 Recognized Expert Top Contributor
What do you mean by queue?

As abstract software engineering terms, a stack is a last-in-first-out (LIFO) structure, while a queue is a first-in-first-out (FIFO) structure. These are fundamentally incompatible. However, actual implementations of stacks and/or queues sometimes sacrifice conceptual purity for flexibility that might be used to breach the incompatibility.
Mar 19 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
4057
by: Chris Cranford | last post by:
I am in the process of implementing a stack machine virtual environment where each entry on the stack is a 32-bit value which then can reference to any memory pointer, numeric value, or alike. ...
4
2612
by: Chris Mabee | last post by:
Hello all, and Merry Christmas, I'm having a problem understanding an example of an array based implementation of a stack in a textbook of mine. The code in question is written below. The syntax...
2
4006
by: AshifToday | last post by:
Expression Evaluation in Post-Fix Notation Using Stack ===================== /* This program has been made by Ashif Zubair. Roll # 1468, B.Sc.(Hons.) in C.S. ALL RIGHTS ARE RESERVED TO ASHIF...
3
2437
by: Thomas Ibbotson | last post by:
I've been going through a tutorial on C++ and I've come across what I regard as some strange behaviour. As part of the tutorial on classes a simple stack is implemented with functions push() and...
20
3448
by: Sushil | last post by:
Hi gurus I was reading FAQ "alloca cannot be written portably, and is difficult to implement on machines without a conventional stack." I understand that the standard does not mandate...
4
6443
by: Dave Bailey | last post by:
I have an application installed on a web server. When forst intalled it worked fine. The administrator rebooted the server and then when accessing the app the folowing error appears: CryptoAPI...
3
7815
by: Teis Draiby | last post by:
I'm looking for some information (books, articles, tutorials) on how to implement a multiple undo/redo framework. I'm a beginner in this so I prefer information specifically targeting C# with code...
1
7495
by: Phil Sandler | last post by:
Hello all, Thanks in advance for any help with this. I am trying to get sample code to run from Michael Russell's excellent article on removing whitespace:...
10
2975
by: javuchi | last post by:
I just want to share some code with you, and have some comments and improvements if you want. This header file allocates and add and delete items of any kind of data from a very fast array: ...
12
2783
by: svkers | last post by:
Hi all, I have a question concerning the implementation of an interface between two layers of a network stack (see extract of the subsequent stack). Furthermore I am thankful for some hints how to...
0
7260
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7162
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7101
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5090
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3234
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3223
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1597
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.