What is the Origin of Queue?Īccording to Dictionary, the word queue has been used in English since the 19th century and 20th century. Something goes in on the front end and comes out the opposite end, in a first-in, first-out order. With a FIFO queue, it is like a line for a rollercoaster. With a LIFO queue, you can think of it as a stack of pancakes - the last in is the first out. Several programs use queues to access information in a predetermined order. In computer science and information processing, a LIFO queue and FIFO queue are computing data structures to hold information in a computer system or operating system. This is a long braid of hair or ponytail running down the back of the neck or head. Do not confuse the word queue with the Spanish word qué or the word cue, a stick used in billiards.Īccording to Your Dictionary, a queue was also an 18th-century men’s hairstyle from Imperial China. This is usually a line of people, but you can have an orderly queue of people or a queue of vehicles. Let’s get started! What Does the Word Queue Mean? His article will tell you all about the various meanings of the word queue, the origin of the word, example sentences containing the word queue, synonyms, translations, and antonyms. Did you know that there are other meanings to this word as well? T AlgorithmĢ.You may have heard the word queue used about a line for something. This operation is used to check the status of the queue with the help of the pointer. The peek() is an operation which is used to retrieve the frontmost element in the queue, without deleting it. Increment front pointer to point to the next available If the queue is not empty, access the data where frontĥ. If the queue is empty, produce underflow error and exit.Ĥ. The following algorithm describes the dequeue() operation in a simpler way. The dequeue() is a data manipulation operation that is used to remove elements from the stack. Add data element to the queue location, where the rearįollowing are the implementations of this operation in various programming languages − If the queue is not full, increment rear pointer to pointĥ. If the queue is full, produce overflow error and exit.Ĥ. The following algorithm describes the enqueue() operation in a simpler way. The enqueue() is a data manipulation operation that is used to insert elements into the stack. The front pointer accesses the data from the front end (helping in enqueueing) while the rear pointer accesses data from the rear end (helping in dequeuing). Queue uses two pointers − front and rear. These are all built-in operations to carry out data manipulation and to check the status of the queue. The most fundamental operations in the queue ADT include: enqueue(), dequeue(), peek(), isFull(), isEmpty(). Queue operations also include initialization of a queue, usage and permanently deleting the data from the memory. As a small example in this tutorial, we implement queues using a one-dimensional array. Similar to the stack ADT, a queue ADT can also be implemented using arrays, linked lists, or pointers. More real-world examples can be seen as queues at the ticket windows and bus-stops. Queue is very frequently used in most programming languages.Ī real-world example of queue can be a single-lane one-way road, where the vehicle enters first, exits first. The data is inserted into the queue through one end and deleted from it using the other end. A queue is an Abstract Data Type (ADT) similar to stack, the thing that makes queue different from stack is that a queue is open at both its ends. DSA - Travelling Salesman Problem (Approximation Approach)Ī queue is a linear data structure where elements are stored in the FIFO (First In First Out) principle where the first element inserted would be the first element to be accessed.DSA - Travelling Salesman Problem (Dynamic Approach).DSA - Longest Common Subsequence Algorithm.DSA - Dijkstra's Shortest Path Algorithm.DSA - Travelling Salesman Problem (Greedy Approach).DSA - Circular Linked List Data Structure.DSA - Doubly Linked List Data Structure.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |