Login
Register
@
Dark Mode
Profile
Edit my Profile
Messages
My favorites
Register
Activity
Q&A
Questions
Unanswered
Tags
Subjects
Users
Ask
Previous Years
Blogs
New Blog
Exams
Dark Mode
# stacks
amit166
asked
in
DS
Jan 6, 2019
retagged
May 20, 2021
by
Shiva Sagar Rao
1,385
views
1
vote
1
vote
How many enqueue and dequeue operations are required to perform a pop operation if Q1 contains n element initially?
data-structures
stack
queue
amit166
asked
in
DS
Jan 6, 2019
retagged
May 20, 2021
by
Shiva Sagar Rao
by
amit166
1.4k
views
answer
comment
Follow
share this
share
0 Comments
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
1
Answer
0
votes
0
votes
n-1 enqueue and n dequeue ???
Priyadrasta Raut
answered
Jan 17, 2019
by
Priyadrasta Raut
comment
Follow
share this
1 comment
by
Spidey_guy
commented
Oct 17, 2019
reply
Follow
share this
can the enqueue operation be (2n-1)?
0
0
Please
log in
or
register
to add a comment.
← Previous
Next →
← Previous in category
Next in category →
Related questions
3
votes
3
votes
1
answer
1
Parshu gate
asked
in
DS
Nov 13, 2017
1,795
views
Queues using stacks
PLEASE PROVIDE SOURCE FOR THIS CONCEPT Suppose that queue operations are implemented using stack operation. enqueue(x) and Dequeue( ) are queue operations whereas Pop( ) and Push(x) are stack operations. Consider the following code Enqueue(S1,x){ Push(S1,x); } Dequeue(S1,S2){ if(!IsEmptyStack S2) ... S2)); and S1; (C) Push (S1, Pop (S2)); and S2; (D) Push (S2, Pop (S1)); and S1;
Parshu gate
asked
in
DS
Nov 13, 2017
by
Parshu gate
1.8k
views
queue
stack
data-structures
7
votes
7
votes
1
answer
2
junaid ahmad
asked
in
DS
Oct 31, 2017
3,982
views
QUEUE USING STACKS
Q.What will be time complexity of enqueue and dequeue operation when a queue is implemented using two stacks.
junaid ahmad
asked
in
DS
Oct 31, 2017
by
junaid ahmad
4.0k
views
data-structures
queue
stack
1
vote
1
vote
1
answer
3
amit166
asked
in
DS
Jan 4, 2019
510
views
# iit goa data strructre
Assume I have a stack s, a queue q, and a binary search tree t. Initially all of them are empty. Indicate the state of the data structures at line number 7 and at the end. What is the maximum height each of the data structures had during the execution? 1 i $\rightarrow$ 0 2 ... 0 8 while i <= 9 do 9 t.insert(s.pop()) 10 t.insert(q.get()) 11 i $\rightarrow$ i + 1 12 end
amit166
asked
in
DS
Jan 4, 2019
by
amit166
510
views
queue
stack
Subscribe to GATE CSE 2024 Test Series
Subscribe to GO Classes for GATE CSE 2024
Quick search syntax
tags
tag:apple
author
user:martin
title
title:apple
content
content:apple
exclude
-tag:apple
force match
+apple
views
views:100
score
score:10
answers
answers:2
is accepted
isaccepted:true
is closed
isclosed:true
Recent Posts
Post GATE 2024 Guidance [Counseling tips and resources]
GATE CSE 2024 Result Responses
[Project Contest] Pytorch backend support for MLCommons Cpp Inference implementation
Participating in MLCommons Inference v4.0 submission (deadline is February 23 12pm IST)
IIITH PGEE 2024 Test Series by GO Classes
Subjects
All categories
General Aptitude
(3.5k)
Engineering Mathematics
(10.4k)
Digital Logic
(3.6k)
Programming and DS
(6.2k)
Programming
(4.1k)
DS
(2.0k)
Algorithms
(4.8k)
Theory of Computation
(6.9k)
Compiler Design
(2.5k)
Operating System
(5.2k)
Databases
(4.8k)
CO and Architecture
(4.0k)
Computer Networks
(4.9k)
Artificial Intelligence
(79)
Machine Learning
(48)
Data Mining and Warehousing
(25)
Non GATE
(1.4k)
Others
(2.7k)
Admissions
(684)
Exam Queries
(1.6k)
Tier 1 Placement Questions
(17)
Job Queries
(80)
Projects
(11)
Unknown Category
(870)
64.3k
questions
77.9k
answers
244k
comments
80.0k
users
Recent Blog Comments
category ?
Hi @Arjun sir, I have obtained a score of 591 in ...
download here
Can you please tell about IIT-H mtech CSE self...
Please add your admission queries here:...
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy