You are not signed in.
To save solutions, earn points and appear on the leaderboard. register or sign in.

Generic Double Ended Queue

Description

Deque or Double Ended Queue is a generalized version of Queue data structure that allows insert and delete at both ends.

It is a mixture of both stack and queue.

A deque can perform the following operations:

1) insertFront()

2) insertLast()

3) delFront() # to delete the front item

4) delLast() # to delete the last item

5) getFront()

6) getLast()

7) isEmpty()

 


Question

Create a generic deque such that it contains the following items:

burger, chesse, 2018, 9, audi, cookies

You need to remove the last 2 elements and the first element.

 


Create a generic deque such that it contains the following items:

burger, chesse, 2018, 9, audi, cookies

You need to remove the last 2 elements and the first element.