Data Structure & Algorithm in Java

⌘K
  1. Home
  2. Docs
  3. Data Structure & Alg...
  4. Queues
  5. Basic Concept of Queue

Basic Concept of Queue

Here are the Basic Concept of Queue:

Basic Concept of Queue

The front (or head) of the queue refers to the element at the beginning of the queue, which will be dequeued next.

  • This is the element that was added earliest to the queue.

The rear (or tail) of the queue refers to the element at the end of the queue, where new elements are enqueued.

  • This is the element that was added most recently to the queue.
  • Like stack, queue is also an ordered list of elements of similar data types.
  • Queue is a FIFO ( First in First Out ) structure.
  • Once a new element is inserted into the Queue, all the elements inserted before the new
    element in the queue must be removed, to remove the new element.
  • peek( ) function is used to return the value of first element without dequeuing it.
Advantages of Queue
Disadvantages of Queue

How can we help?

Leave a Reply

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