queue and deque interfaces

Hi,

What is differnece, dimilary, uses, disadvantages of

queue and deque interfaces. Please adviss
LVL 7
gudii9Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

zzynxSr. Software 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
zzynxSr. Software engineerCommented:
Thanx 4 axxepting
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.