recategorized by
1,655 views
0 votes
0 votes
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 four $O(1)$ time procedures to insert elements into and delete elements from both ends of a deque implemented by an array.
recategorized by

1 Answer

Related questions

1 votes
1 votes
2 answers
1
akash.dinkar12 asked Jun 28, 2019
584 views
Show how to implement a queue using two stacks. Analyze the running time of the queue operations.
0 votes
0 votes
1 answer
2
akash.dinkar12 asked Jun 28, 2019
562 views
Rewrite ENQUEUE and DEQUEUE to detect underflow and overflow of a queue.
4 votes
4 votes
2 answers
4
akash.dinkar12 asked Jun 28, 2019
1,322 views
Show how to implement a stack using two queues. Analyze the running time of the stack operations.