Queue Data StructureLast Updated : 27 Sep, 2023ReadDiscuss(20)CoursesDSA for BeginnersLearn more about Queue in DSA Self Paced CoursePractice Problems on QueueTop Quizzes on QueueWhat is Queue Data Structure?A Queue is defined as a linear data structure that is open at both ends and the operations are performed in First In First Out (FIFO) order.We define a queue to be a list in which all additions to the list are made at one end, and all deletions from the list are made at the other end. The element which is first pushed into the order, the operation is first performed on that.Queue Data StructureFIFO Principle of Queue:A Queue is like a line waiting to purchase tickets, where the first person in line is the first person served. (i.e. First come first serve).Position of the entry in a queue ready to be served, that is, the first entry that will be removed from the queue, is called the front of the queue(sometimes, head of the queue), similarly, the position of the last entry in the queue, that is, the one most recently added, is called the rear (or the tail) of the queue. See the below figure.Fifo Property in QueueCharacteristics of Queue:Queue can handle multiple data.We can access both ends.They are fast and flexible. Queue Representation:Like stacks, Queues can also be represented in an array: In this representation, the Queue is implemented using the array. Variables used in this case areQueue: the name of the array storing queue elements.Front: the index where the first element is stored in the array representing the queue.Rear: the index where the last element is stored in an array representing the queue.Topics :IntroductionQueue in various Programming LanguagesImplementationStandard Problems on Queues Introduction to Queue Data Structure:Introduction to Queue – Data Structure and Algorithm TutorialsImplementations of Queue Data Structure using ArraysImplementations of Queue Data Structure using Linked ListApplications, Advantages and Disadvantages of QueueDifferent Types of QueueImplementation of Queue in various Programming Languages:Queue in C++ Standard Template Library (STL)Queue Interface In JavaQueue In PythonQueue In C#Queue in JavascriptSome other Implementations of Queue Data Structure:Implementation of Deque using doubly linked listImplement a stack using single queueImplement Queue using StacksHow to efficiently implement k Queues in a single array?LRU Cache ImplementationSome Must Solve Standard Problems on Queue Data Structure:Easy:Implement Stack using QueuesDetect cycle in an undirected graph using BFSBreadth First Search or BFS for a GraphTraversing directory in Java using BFSVertical order traversal of Binary Tree using MapPrint Right View of a Binary TreeFind Minimum Depth of a Binary TreeCheck whether a given graph is Bipartite or notMedium:Flatten a multilevel linked listLevel with maximum number of nodesFind if there is a path between two vertices in a directed graphPrint all nodes between two given levels in Binary TreeFind next right node of a given keyMinimum steps to reach target by a KnightIslands in a graph using BFSLevel order traversal line by line | Set 3 (Using One Queue)Find the first non-repeating character from a stream of charactersHard:Sliding Window Maximum (Maximum of all subarrays of size K)Flood Fill AlgorithmMinimum time required to rot all orangesShortest path in a Binary MazeAn Interesting Method to Generate Binary Numbers from 1 to nMaximum cost path from source node to destinationShortest distance between two cells in a matrix or gridSnake and Ladder ProblemFind shortest safe route in a path with landminesCount all possible walks from a source to a destination with exactly K edgesMinimum Cost of Simple Path between two nodes in a directed and weighted graphMinimum Cost Path in a directed graph via given set of intermediate nodesFind the first circular tour that visits all petrol pumpsQuick Links:‘Practice Problems’ on Queue‘Videos’ on Queue‘Quizzes’ on QueueRecomended:Learn Data Structure and Algorithms | DSA TutorialQueue in Go LanguageQueue in Scala