Data Structure & Algorithm in Java

⌘K
  1. Home
  2. Docs
  3. Data Structure & Alg...
  4. Queues
  5. Queue as an ADT

Queue as an ADT

Here is the key explanation of Queue as an ADT:

  1. enqueue(): adds a new item to the rear of the queue. It needs the item and returns nothing.
  2. dequeue(): removes the front item from the queue. It needs no parameters and returns the item. The queue is modified.
  1. isEmpty(): tests to see whether the queue is empty. It needs no parameters and returns a boolean value.
  2. size(): returns the number of items in the queue. It needs no parameters and returns an integer.
  3. first(): returns the first element of the queue, without removing it.

How can we help?

Leave a Reply

Your email address will not be published. Required fields are marked *