queue and deque interfaces

Hi,

What is differnece, dimilary, uses, disadvantages of

queue and deque interfaces. Please adviss
LVL 7
gudii9Asked:
Who is Participating?
 
ozoCommented:
A queue is a structure which can insert elements at one end, and remove elements from another, so access is First In, First Out.
A deque (double ended queue) can insert or remove elements from either end.
A queue or a stack can be considered to be a specialization of deque, and can be implemented as deques.
0
 
gudii9Author Commented:
A queue or a stack can be considered to be a specialization of deque, and can be implemented as deques.

i thought otherway where deque is specialization of queue.

As deque has better features though more recent addition to java. Please advise
0
 
ozoCommented:
A deque does more than a queue, so it would be a generalization of a queue.
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
zzynxSoftware engineerCommented:
>> i thought otherway where deque is specialization of queue.
You're right, gudii9.

>> A deque does more than a queue, so it would be a generalization of a queue.
I think that's incorrect.
Deque's, BlockingQueue's, TransferQueue's,... do more than a Queue, so it are specialization's of a Queue.
A Queue is a generalization of a Deque, a BlockingQueue, a TransferQueue,...

Since
public interface Deque<E> extends Queue<E>

Open in new window

Queue is the superinterface of Deque or Deque is the subinterface of Queue.

cf. Generalization, Specialization, and Inheritance
0
 
ozoCommented:
I suppose it can be a matter of perspective.
More generalization from the outside requires more specialization on the inside, and vice versa.
The General Theory of Relativity is more widely applicable than the Special Theory of Relativity, but less widely understood.
0
 
gudii9Author Commented:
More generalization from the outside requires more specialization on the inside, and vice versa.
The General Theory of Relativity is more widely applicable than the Special Theory of Relativity, but less widely understood.

can you please elaborate on this. I think i did not get this.
0
 
ozoCommented:
General Relativity is applicable in more general situations.
Special Relativity is only be applicable in more specialized situations.
If Special Relativity is applicable to a situation, then General Relativity is also applicable.

On the other hand, in terms of who can apply it:
Special Relativity can be applied by more people and is more generally well known.
General Relativity can only be applied by people who have mastered more special knowledge.
If a person understands General Relativity, then they also understand Special Relativity.

The former point of view is the one from which I would call a deque more general than a queue.
0
 
zzynxSoftware engineerCommented:
Thanx 4 axxepting
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.