Your friend Bill says The enqueue and dequeue queue operatio
Your friend Bill says, \"The enqueue and dequeue queue operations are inverses of each other. Therefore, performing an enqueue followed by a dequeue is always equivalent to performing a dequeue followed by an enqueue. You get the same result!\" How would you respond to that? Do you agree?
Solution
Yes , we get the same result.
A queue data structure follows a \"First in First Out\" policy where the first element is pushed into the queue or enqueued and the same element when it has to be removed from the queue is Dequeued.
You enqueue items at one end and dequeue at the other.
Eg : enqueued==> |3|2|1| ====> Dequeued.
