Queues is based on FIFO model means first in first out.
Jis tarh ham stacks me data add krne ke liye push use krte the usi tarh QUEUES me data add krne ke enqueue likhte hai and if u want to remove element from queues we will use dequeue
Queues me sare insertion rear end me hota hai.
In Java, a queue is a data structure that follows the First-In-First-Out (FIFO) principle, meaning that the element added first will be removed first. Java provides several implementations of queues through the Queue
interface, which is a part of the Java Collections Framework. The Queue
interface extends the Collection
interface and adds specific methods relevant to queues.
Problem statement
A queue is a ?
Ans: FIFO (First in First out)
Implenting queue in Array;
Comments
Post a Comment