answersLogoWhite

0

What is queues and stacks?

Updated: 9/18/2023
User Avatar

Wiki User

9y ago

Best Answer

A stack is a data structure in which last item inserted is taken out first . That's why they are known as LIFO (last in first out). Inserting an item in stack is termed as push and taking an item out from stack I s termed as pop. Some applications of stack are : Polish notation, reversing string, backtracking , quick sort algorithm etc. The queue is a linear data structure where operations od insertion and deletion are performed at separate ends also known as front and rear. Queue is a FIFO structure that is first in first out. Whenever a new item is added to queue, rear pointer is used. and the front pointer is used when an item is deleted from the queue.

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is queues and stacks?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Calculus

What are advantages and disadvantages of circular queue over ordinary queue?

Circular queues are very efficient and work well with low level codes. Ordinary queues are the standard type of queue but they do not maximize memory data well.


Application of queues in real life?

Real life examples:-a) People standing in a line to board a bus:- The person who stand first in the line get into the bus first and the person who stand last in the line board the bus last. This follows the First-in-first-out (FIFO) principle of queue.b) Phone answering system :- Person who would call first gets a response first and the person who would call last gets the response last. This follows the FIFO principle of queue.c) Person waiting outside cinema hall:- Person who would be checked first will get into the cinema hall first and the person who would be checked last would get into the cinema hall last. This follows the FIFO principle of queue.d) Luggage checking machine:- Luggage that would be put first in the machine would be checked first and the luggage that will be put at the last would be checked last. This follows the FIFO principle of queue.e) Patient wait outside the clinic :- Patient who come first visit the doctor first and the patient who comes last visit the doctor last. This follows the FIFO principle of queue.f) Vehicles on toll-tax bridge :- The vehicles that comes first to the toll tax booth will leave the booth first and the vehicle that comes last would leave the booth last. This follows the FIFO principle of queue.AKANKSHA


Related questions

Differences between stacks and qeues?

stacks work in by the process of (LIFO) last in first out. While queues use the process of (FIFO) first in first out.


Is String a linear data structure?

yes it is, other linear data structures are lists,queues,stacks,arrays


How do you determine symmetry of a data structure For example how do you know if a Stack or a queue or a priority queue or a double ended queue are symmetric?

You can determine symmetry of a data structure in two ways. One is when the stacks and queues data are put in the application and when the stacks are put in during run-time.


What is Linear and non linear list in data structure?

Linear : Traversal is linear .. ex: array,linked lists,stacks,queues NoN-linear: Traversal is not linear.. ex:trees,graphs imagine the situation of searching of particular element..in above scenarious..then u will understand easily.. Linear : Traversal is linear .. ex: array,linked lists,stacks,queues NoN-linear: Traversal is not linear.. ex:trees,graphs imagine the situation of searching of particular element..in above scenarious..then u will understand easily.. Linear : Traversal is linear .. ex: array,linked lists,stacks,queues NoN-linear: Traversal is not linear.. ex:trees,graphs imagine the situation of searching of particular element..in above scenarious..then u will understand easily..


Examples of primitive and non primitive scheduling?

The latter isn't primitive. Most likely it means 'non trivial', 'adaptive' or 'sophisticated'.


What are the advantages of building ISR queues?

ISR queues


What is the plural of queue?

Queues is the plural of queue.


What is the plural form of queue?

The plural form of "queue" is "queues."


How do you implement queue using stack in c plus plus?

A queue in any language is a singly-linked list structure that permits new data to be inserted only at the end of a list while existing data can only be extracted from the beginning of the list. Queues are also known as a first in, first out (FIFO) structure. Unlike a standard singly-linked list, the list maintains a pointer to the last node as well as the first, in order to insert new data and extract existing data in constant time. Variations on the queue include the priority queue which permit data to be weighted, such that data with the greatest priority is promoted to the front of the queue, behind any existing data with the same or higher priority, using an insertion sort technique. Insertion is therefore achieved in linear time rather than constant time, however extraction is always in constant time.


What is property of queues?

When you are registering your property and its in the queue for registration process, this is called property of queues..


How many stacks of 100 dollar bills are in 193000000?

193,000,000/100 = 1,930,000 stacks. 193,000,000/100 = 1,930,000 stacks. 193,000,000/100 = 1,930,000 stacks. 193,000,000/100 = 1,930,000 stacks.


What are stacks of thylakoids called?

granum are stacks of thylakoids. grana are several stacks of thylakoids. :)