The Gateway to Computer Science Excellence
For all GATE CSE Questions
Toggle navigation
GATE Overflow
Facebook Login
Google Login
or
Email or Username
Password
Remember
Login
Register

I forgot my password
All Activity
Questions
Unanswered
Tags
Subjects
Users
Ask
Previous
Blogs
New Blog
Exams
First time here? Checkout the
FAQ
!
x
×
Close
Use the google search bar on side panel. It searches through all previous GATE/other questions. For hardcopy of previous year questions please see
here
Recent questions tagged queues
0
votes
1
answer
1
conceptual doubt
WHAT IS THE TIME COMPLEXITY TO ENQUEUE AN ELEMENT IF THE QUEUE IS IMPLEMENTED AS A CIRCULAR QUEUE AND WE HAVE GOT ONLY ONE POINTER TO FRONT ELEMENT??
asked
Sep 20
in
DS
by
sushmita
Boss
(
15k
points)

122
views
datastructure
linkedlists
timecomplexity
queues
0
votes
1
answer
2
Made easy
https://gateoverflow.in/?qa=blob&qa_blobid=11435838562783483664 Approach for Q9 please . (Please note: it is the last question on left hand side, and part of it is written on right hand side) Answer is d, but according to me it should be b as in 3 situation ... elements but won't be restored in it's original state as mentioned in question. So only 1 and 2 is possible. Is it correct?
asked
Jul 30
in
DS
by
manvi_agarwal
(
109
points)

65
views
madeeasybooklet
datastructure
queues
0
votes
1
answer
3
Self doubt
What are the minimum number of pointers required to implement a stack using single ended queue ( the queue is NOT a dequeue )?
asked
Jul 26
in
DS
by
kapilbk1996
(
379
points)

88
views
stack
queues
datastructure
pointers
0
votes
1
answer
4
Implement stack and queue using priority queue
asked
Jun 17
in
Algorithms
by
pallaviamu
(
205
points)

101
views
clrs
datastructure
stack
queues
priorityqueue
0
votes
0
answers
5
Implementation of Stack and Queue
In implementation of queue using stack, deletion of second element from front take Ο(n) time, when insertion take Ο(1) time. Is it a true statement ? Well it can be true isn't it ? because suppose elements come we simply push them without taking care of ... to stack1. dnQueue(q) 1) If stack1 is empty then error 2) Pop an item from stack1 and return it Am i right?
asked
May 5
in
Programming
by
Na462
Loyal
(
6.9k
points)

157
views
datastructure
queues
stack
0
votes
1
answer
6
GATE 2013
Its GATE 2013 question Consider the following operation along with Enqueue and Dequeue operations on queues, where k is a global parameter. MultiDequeue(Q){ m = k while (Q is not empty) and (m > 0) { Dequeue(Q) m = m  1 } } What is the worst case time complexity of a ... performed on nonempty or full queue?? Due to this change will the answer remain same?? Θ(n) Θ(n + k) Θ(nk) Θ(n2)
asked
May 1
in
DS
by
!KARAN
Junior
(
677
points)

122
views
queues
0
votes
1
answer
7
#Test_Series
Consider implementation of stack using queue by following algorithm. Let $x$ be an element to be pushed in the stack push(q1,x) { EQ(q1,x) while(q1 does not contain 1 element) { k=DQ(q1) EQ(q1,k) } } pop(q1) { DQ(q1) } How many enqueue and dequeue operations required to push $2$ and pop $2$ elements in the empty stack?
asked
Apr 30
in
DS
by
himgta
Active
(
2.3k
points)

93
views
datastructure
stack
queues
0
votes
1
answer
8
Stack and queue
Hi please verify me We can implement a stack using only one queue. Like first insert into queue and for popping a element from stack dequeue n1 element from queue and enque into queue and then pop last element and do the same each time......try it and verify that I am right or wrong?
asked
Apr 7
in
Programming
by
Ravi prakash pandey
Junior
(
779
points)

162
views
datastructure
queues
stack
+11
votes
2
answers
9
GATE20183
A queue is implemented using a noncircular singly linked list. The queue has a head pointer and a tail pointer, as shown in the figure. Let $n$ denote the number of nodes in the queue. Let 'enqueue' be implemented by inserting a new node at the head, and 'dequeue' be implemented by deletion ... $\theta(1), \theta(1)$ $\theta(1), \theta(n)$ $\theta(n), \theta(1)$ $\theta(n), \theta(n)$
asked
Feb 14
in
DS
by
gatecse
Boss
(
18.3k
points)

2.4k
views
gate2018
algorithms
datastructure
queues
normal
linkedlists
0
votes
0
answers
10
Made Easy Mock 1
Consider the following statements: S1 : Implementation of stack using queue, deletion of second element from top of stack time complexity Ο(n), when insertion take Ο(1) time. S2 : In implementation of queue using stack, deletion of second element from front ... Ο(n) time. Both the statements are true. HOW? Kindly provide a detailed explanation. I am unable to solve such questions.
asked
Jan 31
in
DS
by
_jerry
(
353
points)

131
views
madeeasytestseries
datastructure
stack
queues
+1
vote
1
answer
11
ME  BASIC  4 Data Structures
Consider the following statements: S1: If stack is implemented as an array, all the operation push, pop, is_empty stack ( ), delete stack ( ) can be performed in constant time. S2: If stack is implemented as a linked list, all the ... structure. S4: Circular queues can be implemented with the help of the stack data structure. Which of the following option is false?
asked
Jan 23
in
DS
by
Rishabh Gupta 2
Boss
(
15.1k
points)

272
views
madeeasytestseries
datastructure
stack
queues
+2
votes
1
answer
12
Implementation of queue using stack
In implementation of queue using stack, deletion of second element from front take Ο(1) time, when insertion take Ο(n) time. Which of the following is correct ? True / False
asked
Jan 20
in
Algorithms
by
Hemant Parihar
Boss
(
15.4k
points)

272
views
datastructure
queues
stack
+1
vote
1
answer
13
Test series
Can someone explain the solution along with a picture of how the steps are taking place?
asked
Jan 20
in
DS
by
Kalpataru Bose
(
487
points)

99
views
madeeasytestseries
programminginc
queues
+1
vote
2
answers
14
Implementation of stack using queues
What are the minimum enqueue and dequeue operations needed to perform pop operation for a stack which is implemented with two queues if there are already 10 elements in the first queue?
asked
Jan 12
in
DS
by
Ibtisam Sayyad
(
17
points)

275
views
datastructure
stack
queues
+1
vote
0
answers
15
made easy test series
Consider the following statements: S1 : Implementation of stack using queue, deletion of second element from top of stack time complexity Ο(n), when insertion take Ο(1) time. S2 : In implementation of queue using stack, deletion of second element from front take Ο(1) time, when insertion take Ο(n) time. Which of the following is correct ?
asked
Jan 3
in
Programming
by
chandra sai
Active
(
1.2k
points)

169
views
stack
queues
datastructure
0
votes
0
answers
16
Queue
Consider the following statements: S1 : Implementation of stack using queue, deletion of second element from top of stack time complexity Ο(n), when insertion take Ο(1) time. S2 : In implementation of queue using stack, deletion of second element from front take Ο(1) time, when insertion take Ο(n) time. Why both statements are correct
asked
Dec 12, 2017
in
Programming
by
Shivi rao
Junior
(
785
points)

85
views
queues
datastructure
+2
votes
0
answers
17
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;
asked
Nov 13, 2017
in
DS
by
Parshu gate
Active
(
5k
points)

212
views
queues
stack
datastructure
+1
vote
1
answer
18
stack operations using queue
Suppose Stack operations are implemented using Queue Operation. Push(x) and Pop() are stack operations whereas enqueue(x) and dequeue are Queue operations. Consider the code: pop() { return Q.dequeue(); } push(x) { n= Q.size(); //Q.size() returns the number of ... operation correctly (A) Q.enqueue(x) (B) Q.enqueue(Q.deqeue()) (C) Q.dequeue(Q.enqueue(x)) (D) Q.dequeue()
asked
Nov 12, 2017
in
DS
by
Parshu gate
Active
(
5k
points)

289
views
datastructure
stack
queues
priorityqueue
+4
votes
1
answer
19
QUEUE USING STACKS
Q.What will be time complexity of enqueue and dequeue operation when a queue is implemented using two stacks.
asked
Oct 31, 2017
in
DS
by
junaid ahmad
Loyal
(
9.1k
points)

658
views
datastructure
queues
stack
+1
vote
2
answers
20
Circular queue
The initial configuration of circular queue as follows What is status of states of queue contents after the following sequence of steps enqueue x dequeue enqueue y dequeue dequeue a)x,y,____,_____,_____ b)x,___,y,____,____ c)____,_____,x,y,____ d)_____,x,y,_____,_____
asked
Oct 29, 2017
in
DS
by
srestha
Veteran
(
101k
points)

253
views
datastructure
circularqueue
queues
+2
votes
1
answer
21
Linked List
Which of the following operations is performed more efficiently by doubly linked list than by linear linked list? (a). Deleting a node whose location is given. (b). Searching an unsorted list of a given item. (c). inserting a node after the node with a given location. (d). Traversing the list to process each node.
asked
Oct 26, 2017
in
Programming
by
Shubham Kumar Gupta
Junior
(
603
points)

175
views
linkedlists
datastructure
programminginc
queues
0
votes
1
answer
22
Circular Queue
#DS I have this confusion in concluding the overflow condition of a circular Queue i.e. when the circular queue will be considered full. As per the text i have, it says a circular queue is full when: Front=0 and Rear=MAX1 ; which seems quite straight forward. eg: The ... the overflow condition of a circular Queue be: if((Front==0 && Rear==MAX1)  (Rear==Front1)) ???
asked
Oct 24, 2017
in
Programming
by
nick17india
(
55
points)

223
views
queues
datastructure
circularqueue
+4
votes
2
answers
23
Queue implementaion using stack
A queue is implemented using 2 stacks. Minimum no. of stack operations (PUSH and POP) required for the sequence of 3 insertions and 2 delete operations in the queue is  .
asked
Oct 9, 2017
in
DS
by
SSrawat
(
119
points)

385
views
stack
queues
datastructure
+1
vote
0
answers
24
queue
A queue is implemented using two stack A and B. Consider the following code void enqueue(int value) { While (!B.is Empty()) A.push(B.Pop()); A. push (value); } int dequeue () { While (!A.is Empty()) {X} return B.Pop(); } if enqueue is implemented using two stacks A & B With ... )); B) B.Push(A.Pop()); C) A.Pop(B. Push ()); D) B.Pop(A. Push ()); what is difference between option b,d???
asked
Oct 1, 2017
in
DS
by
Hira Thakur
Boss
(
13.1k
points)

131
views
queues
0
votes
0
answers
25
Queue
If (rear==maxsize1) rear=0; else rear=rear+1; is required in circular queue or deque ?? I think it is circular queue but ans is deque...plzzz make me out..
asked
Sep 26, 2017
in
DS
by
rishu_darkshadow
Loyal
(
7.5k
points)

97
views
queues
0
votes
1
answer
26
Circular Queue
a)a_cb_ b)_abc_ c)abc_ _ d)_ab_c
asked
Aug 21, 2017
in
Programming
by
Xylene
Active
(
3.9k
points)

201
views
datastructure
circularqueue
queues
+1
vote
1
answer
27
queue
The initial configuration of queue is a, b, c, d. ‘a’ is at the front. To get the configuration d, c, b, a how many deletions and additions required: (A) 2 deletions, 3 additions (B) 3 deletions, 2 additions (C) 3 deletions, 4 additions (D) 3 deletions, 3 additions
asked
Jun 27, 2017
in
Programming
by
akankshadewangan24
Active
(
4.2k
points)

723
views
queues
0
votes
3
answers
28
#Number of Elements in Circular Queues and Simple Queues #Doubt
asked
Jun 19, 2017
in
DS
by
Roshan Pawar
(
427
points)

477
views
queues
circularqueue
+1
vote
2
answers
29
#GateForum Correspondence Course (Page# 131, Q# 7), #Queue
asked
Jun 19, 2017
in
DS
by
Roshan Pawar
(
427
points)

177
views
queues
circular
+1
vote
2
answers
30
Linked List implementation of Queue
Which of the following is true about linked list implementation of queue? (a) In push operation, if new nodes are inserted at the beginning of linked list, then in pop operation, nodes must be removed from end. (b) In push operation, if new nodes are ... (1) TC answer should be (b) But If we are allowed to use doubly linked list then answer should be C only ryt?
asked
Jun 10, 2017
in
Programming
by
Shubhanshu
Boss
(
16.3k
points)

642
views
linkedlists
datastructure
queues
Page:
1
2
next »
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
SCREENSHOT
Basic LaTeX guide
IIT Madras Phd
Databases GO Classroom
Happy Birthday Sir Arjun
Follow @csegate
Gatecse
Recent questions tagged queues
Recent Blog Comments
Sir for final year student who have exam in...
I guess you meant while chasing :) Anyway those...
I'll write a post on how to best...
@Gaurav Go through all the previous yr questions,...
42,609
questions
48,608
answers
155,775
comments
63,775
users