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

I forgot my password
Activity
Questions
Unanswered
Tags
Subjects
Users
Ask
Prev
Blogs
New Blog
Exams
Recent questions tagged queues
+1
vote
1
answer
1
CMI2018B7
A First In First Out queue is a data structure supporting the operation Enque, Deque, Print, Enque(x) adds the item $x$ to the tail of the queue. Deque removes the element at the head of the queue and returns its value. Print prints the head of the ... reverse order. If the queue had $n$ elements to begin with, how many statements would you need to print the queue in reverse order?
asked
Sep 13, 2019
in
DS
by
gatecse
Boss
(
17.6k
points)

75
views
cmi2018
datastructures
queues
descriptive
0
votes
0
answers
2
Cormen Edition 3 Exercise 10.1 Question 6 (Page No. 236)
Show how to implement a queue using two stacks. Analyze the running time of the queue operations.
asked
Jun 28, 2019
in
Algorithms
by
akash.dinkar12
Boss
(
42.7k
points)

29
views
cormen
datastructures
queues
descriptive
0
votes
1
answer
3
Cormen Edition 3 Exercise 10.1 Question 5 (Page No. 236)
Whereas a stack allows insertion and deletion of elements at only one end, and a queue allows insertion at one end and deletion at the other end, a deque (double ended queue) allows insertion and deletion at both ends. Write ... time procedures to insert elements into and delete elements from both ends of a deque implemented by an array.
asked
Jun 28, 2019
in
Algorithms
by
akash.dinkar12
Boss
(
42.7k
points)

56
views
cormen
algorithms
datastructures
queues
descriptive
0
votes
0
answers
4
Cormen Edition 3 Exercise 10.1 Question 4 (Page No. 235)
Rewrite ENQUEUE and DEQUEUE to detect underflow and overflow of a queue.
asked
Jun 28, 2019
in
Algorithms
by
akash.dinkar12
Boss
(
42.7k
points)

32
views
cormen
datastructures
queues
descriptive
0
votes
0
answers
5
Cormen Edition 3 Exercise 10.1 Question 3 (Page No. 235)
ENQUEUE(Q, x) 1 Q[Q.tail] = x 2 if Q.tail == Q.length 3 Q.tail = 1 4 else Q.tail = Q.tail + 1 DEQUEUE(Q) 1 x = Q[Q.head] 2 if Q.head == Q.length 3 Q.head = 1 4 else Q.head = Q.head + 1 5 return x illustrate the ... (Q,4),ENQUEUE(Q,1),ENQUEUE(Q,3),DEQUEUE(Q),ENQUEUE(Q,8),DEQUEUE(Q) on an initially empty queue $Q$ stored in array $Q[1...6]$.
asked
Jun 28, 2019
in
Algorithms
by
akash.dinkar12
Boss
(
42.7k
points)

41
views
cormen
datastructures
queues
descriptive
0
votes
0
answers
6
Data Structures in C by Sahni  Circular Queue using Dynamic Arrays
I'm learning data structures from a book. In the topic, Circular Queue using Dynamic Array, the author has mentioned below point, Let capacity be the initial capacity of the circular queue,We must first increase the size of ... capacity elements. But how does array doubling and slide to right copy at most 2 * capacity 2 elements??
asked
Apr 14, 2019
in
DS
by
Durga Teja
(
31
points)

165
views
datastructures
queues
0
votes
1
answer
7
Made easy
asked
Jan 28, 2019
in
Programming
by
Jyoti Kumari97
(
187
points)

115
views
datastructures
queues
circularqueue
0
votes
0
answers
8
Stack implementation by using queue
true/false ? ) if stack is implemented as a array,all operation push ,pop ,is emptystack(),delete stack() can be performed in constant time. )if stack is implemented as a linked list ,all operation ,is emptystack(),delete stack() can be performed in constant time.
asked
Jan 2, 2019
in
Programming
by
Gurdeep Saini
Boss
(
10.6k
points)

173
views
datastructures
queues
stack
0
votes
0
answers
9
Gateforum Class Notes
The array implementation of Queue throws an error when the array limit has been reached. So we consider the following alternative. Create a larger array using redefine function. The cost of the redefine that makes the array larger is proportional to the new size. Suppose we expand the array ... $N$ insertions will take. $O(N^2)$ $O(N^3)$ $O(N)$ $O(log_2N)$ Answer provided: $A$
asked
Dec 23, 2018
in
DS
by
Gupta731
Active
(
4.9k
points)

144
views
datastructures
queues
0
votes
0
answers
10
Priority Queue
Is priority queue work efficiently with sorted array than unsorted array and heap for insertion and deletion operation? Then why do we apply priority queue in heap specially
asked
Dec 22, 2018
in
DS
by
srestha
Veteran
(
119k
points)

120
views
datastructures
priorityqueue
queues
0
votes
1
answer
11
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, 2018
in
DS
by
sushmita
Boss
(
17.8k
points)

204
views
datastructures
linkedlists
timecomplexity
queues
0
votes
1
answer
12
MadeEasy Workbook
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 ... 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, 2018
in
DS
by
manvi_agarwal
(
111
points)

114
views
madeeasybooklet
datastructures
queues
seelater
0
votes
1
answer
13
MadeEasy Workbook: Programming & DS  Queues
https://gateoverflow.in/?qa=blob&qa_blobid=10936115150698131975
asked
Jul 30, 2018
in
DS
by
manvi_agarwal
(
111
points)

56
views
madeeasyworkbook
datastructures
queues
0
votes
1
answer
14
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, 2018
in
DS
by
kapilbk1996
(
409
points)

133
views
stack
queues
datastructures
pointers
0
votes
1
answer
15
Implement stack and queue using priority queue
On other sources, it is given that we need to assign high priorities to newly inserted element in case of stack otherwise low priority to newly inserted element in case of queue. My doubt here is that shouldn't ... heap priority queue and queue with minheap priority queue keeping above assumption of assigning priorities to newly inserted element?
asked
Jun 17, 2018
in
Algorithms
by
pallaviamu
(
477
points)

321
views
clrs
datastructures
stack
queues
priorityqueue
0
votes
0
answers
16
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, 2018
in
Programming
by
Na462
Loyal
(
7.1k
points)

285
views
datastructures
queues
stack
0
votes
1
answer
17
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, 2018
in
DS
by
!KARAN
Active
(
2.4k
points)

185
views
queues
0
votes
1
answer
18
#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, 2018
in
DS
by
himgta
Active
(
3.7k
points)

169
views
datastructures
stack
queues
0
votes
1
answer
19
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, 2018
in
Programming
by
Ravi prakash pandey
Junior
(
657
points)

299
views
datastructures
queues
stack
+18
votes
4
answers
20
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, 2018
in
DS
by
gatecse
Boss
(
17.6k
points)

4k
views
gate2018
algorithms
datastructures
queues
normal
linkedlists
0
votes
0
answers
21
MadeEasy Test Series: Programming & DS  Stack And Queues
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, ... . Both the statements are true. HOW? Kindly provide a detailed explanation. I am unable to solve such questions.
asked
Jan 31, 2018
in
DS
by
_jerry
(
341
points)

262
views
madeeasytestseries
datastructures
stack
queues
+1
vote
1
answer
22
MadeEasy Test Series 2018: Programming & DS  Stack
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, ... S4: Circular queues can be implemented with the help of the stack data structure. Which of the following option is false?
asked
Jan 23, 2018
in
DS
by
Rishabh Gupta 2
Boss
(
18k
points)

419
views
datastructures
stack
queues
madeeasytestseries
+2
votes
1
answer
23
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, 2018
in
Algorithms
by
Hemant Parihar
Boss
(
16.6k
points)

440
views
datastructures
queues
stack
+1
vote
1
answer
24
MadeEasy Test Series 2018: Programming & DS  Queues
Can someone explain the solution along with a picture of how the steps are taking place?
asked
Jan 20, 2018
in
DS
by
Kalpataru Bose
(
423
points)

152
views
madeeasytestseries
programminginc
queues
+1
vote
2
answers
25
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, 2018
in
DS
by
Ibtisam Sayyad
(
11
points)

730
views
datastructures
stack
queues
+3
votes
0
answers
26
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, 2018
in
Programming
by
chandra sai
Active
(
1.3k
points)

343
views
stack
queues
datastructures
0
votes
0
answers
27
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
(
537
points)

133
views
queues
datastructures
+3
votes
3
answers
28
MadeEasy Subject Test: Programming & DS  Stack
asked
Nov 14, 2017
in
DS
by
charul
Junior
(
823
points)

155
views
madeeasytestseries
datastructures
stack
queues
+2
votes
0
answers
29
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
(
3.2k
points)

499
views
queues
stack
datastructures
+1
vote
2
answers
30
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
(
3.2k
points)

435
views
datastructures
stack
queues
priorityqueue
Page:
1
2
3
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
NIELIT Scientist – 'B' 2020
GATE CSE: IIT Bombay Admissions
Open Source Projects to work on after GATE
Interview Experiences List
Admission Procedure in IIITD
Follow @csegate
Recent questions tagged queues
Recent Blog Comments
Syllabus seems to be superset of Gate Syllabus.
Yes. You'll likely get it.
I am getting(as per GO pragy app) : 68 marks...
What was your score?
Was it coding test (on system) or on paper?
50,833
questions
57,737
answers
199,467
comments
107,991
users