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
Recent questions tagged queue
0
votes
1
answer
61
Cormen Edition 3 Exercise 10.1 Question 4 (Page No. 235)
Rewrite ENQUEUE and DEQUEUE to detect underflow and overflow of a queue.
akash.dinkar12
asked
in
Algorithms
Jun 28, 2019
by
akash.dinkar12
560
views
cormen
data-structures
queue
descriptive
0
votes
1
answer
62
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]$.
akash.dinkar12
asked
in
Algorithms
Jun 28, 2019
by
akash.dinkar12
414
views
cormen
data-structures
queue
descriptive
0
votes
0
answers
63
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 ... elements. But how does array doubling and slide to right copy at most 2 * capacity -2 elements??
Durga Teja
asked
in
DS
Apr 14, 2019
by
Durga Teja
1.5k
views
data-structures
queue
0
votes
1
answer
64
Made easy
Jyoti Kumari97
asked
in
Programming in C
Jan 28, 2019
by
Jyoti Kumari97
592
views
data-structures
queue
circular-queue
0
votes
1
answer
65
Gate cs 2017
A circular queue has been implemented using a singly linked list where each node consists of a value and a single pointer pointing to the next node. We maintain exactly two external pointers FRONT and REAR pointing to the front node and the rear node of the queue, ... node to front. We dont need to do this. So why B is the correct answer?D should be correct ? please explain.
sadiashafaque
asked
in
DS
Jan 22, 2019
by
sadiashafaque
711
views
usergate2017
usermod
queue
1
vote
1
answer
66
# stacks
How many enqueue and dequeue operations are required to perform a pop operation if Q1 contains n element initially?
amit166
asked
in
DS
Jan 6, 2019
by
amit166
1.4k
views
data-structures
stack
queue
1
vote
1
answer
67
# 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
506
views
queue
stack
2
votes
2
answers
68
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.
Gurdeep Saini
asked
in
Programming in C
Jan 2, 2019
by
Gurdeep Saini
1.4k
views
data-structures
queue
stack
0
votes
0
answers
69
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$
Gupta731
asked
in
DS
Dec 23, 2018
by
Gupta731
509
views
data-structures
queue
0
votes
0
answers
70
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
srestha
asked
in
DS
Dec 22, 2018
by
srestha
593
views
data-structures
priority-queue
queue
2
votes
3
answers
71
NIELIT 2018-69
____ number of queues are needed to implement a stack $1$ $2$ $3$ $4$
Arjun
asked
in
DS
Dec 7, 2018
by
Arjun
3.2k
views
nielit-2018
data-structures
queue
0
votes
1
answer
72
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??
sushmita
asked
in
DS
Sep 20, 2018
by
sushmita
1.2k
views
data-structures
linked-list
time-complexity
queue
0
votes
0
answers
73
#self doubt
1) How many stacks are needed to implement a queue . 2) How many queue are needed to implement a stack.
Shubham Aggarwal
asked
in
DS
Aug 30, 2018
by
Shubham Aggarwal
250
views
queue
0
votes
1
answer
74
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 ... but won't be restored in it's original state as mentioned in question. So only 1 and 2 is possible. Is it correct?
manvi_agarwal
asked
in
DS
Jul 30, 2018
by
manvi_agarwal
2.0k
views
made-easy-booklet
data-structures
queue
see-later
0
votes
1
answer
75
MadeEasy Workbook: Programming & DS - Queues
https://gateoverflow.in/?qa=blob&qa_blobid=10936115150698131975
manvi_agarwal
asked
in
DS
Jul 29, 2018
by
manvi_agarwal
323
views
made-easy-workbook
data-structures
queue
1
vote
2
answers
76
Self doubt
What are the minimum number of pointers required to implement a stack using single ended queue ( the queue is NOT a dequeue )?
kapilbk1996
asked
in
DS
Jul 26, 2018
by
kapilbk1996
1.1k
views
stack
queue
data-structures
pointers
1
vote
0
answers
77
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 ... to stack1. dnQueue(q) 1) If stack1 is empty then error 2) Pop an item from stack1 and return it Am i right?
Na462
asked
in
Programming in C
May 5, 2018
by
Na462
1.8k
views
data-structures
queue
stack
0
votes
1
answer
78
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 non-empty or full queue?? Due to this change will the answer remain same?? Θ(n) Θ(n + k) Θ(nk) Θ(n2)
!KARAN
asked
in
DS
Apr 30, 2018
by
!KARAN
1.0k
views
queue
2
votes
2
answers
79
#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?
himgta
asked
in
DS
Apr 30, 2018
by
himgta
871
views
data-structures
stack
queue
1
vote
1
answer
80
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 n-1 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?
Ravi prakash pandey
asked
in
Programming in C
Apr 7, 2018
by
Ravi prakash pandey
1.1k
views
data-structures
queue
stack
36
votes
6
answers
81
GATE CSE 2018 | Question: 3
A queue is implemented using a non-circular 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' ... $\Theta(1), \Theta(n)$ $\Theta(n), \Theta(1)$ $\Theta(n), \Theta(n)$
gatecse
asked
in
DS
Feb 14, 2018
by
gatecse
15.3k
views
gatecse-2018
algorithms
data-structures
queue
normal
linked-list
1-mark
2
votes
3
answers
82
#Push & #Pop
A queue is implemented using two stacks S1 and S2. Initially the queue contains 1, 2, 3, 4 from front to rear. The following operations are performed in the queue: delete, insert (5), delete, Then how many total no. of push and pop operations are needed to perform the above operation? a) Push: 12 Pop: 13 b) Push: 15 Pop: 16 c) Push: 11 Pop: 10 d) Push: 12 Pop: 11
Tuhin Dutta
asked
in
DS
Jan 31, 2018
by
Tuhin Dutta
1.0k
views
data-structures
stack
queue
3
votes
5
answers
83
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?
Rishabh Gupta 2
asked
in
DS
Jan 23, 2018
by
Rishabh Gupta 2
2.7k
views
data-structures
stack
queue
made-easy-test-series
4
votes
1
answer
84
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
Hemant Parihar
asked
in
DS
Jan 20, 2018
by
Hemant Parihar
1.5k
views
data-structures
queue
time-complexity
true-false
1
vote
1
answer
85
MadeEasy Test Series 2018: Programming & DS - Queues
Can someone explain the solution along with a picture of how the steps are taking place?
Kalpataru Bose
asked
in
DS
Jan 19, 2018
by
Kalpataru Bose
454
views
made-easy-test-series
programming-in-c
queue
3
votes
3
answers
86
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?
Ibtisam Sayyad
asked
in
DS
Jan 12, 2018
by
Ibtisam Sayyad
7.9k
views
data-structures
stack
queue
4
votes
1
answer
87
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 ?
chandra sai
asked
in
Programming in C
Jan 3, 2018
by
chandra sai
3.3k
views
stack
queue
data-structures
0
votes
1
answer
88
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
Shivi rao
asked
in
Programming in C
Dec 12, 2017
by
Shivi rao
897
views
queue
data-structures
3
votes
1
answer
89
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
2
votes
1
answer
90
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()
Parshu gate
asked
in
DS
Nov 11, 2017
by
Parshu gate
1.2k
views
data-structures
stack
queue
priority-queue
Page:
« prev
1
2
3
4
5
next »
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)
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 questions tagged queue
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:...