{"id":6367,"date":"2025-11-13T11:35:41","date_gmt":"2025-11-13T06:05:41","guid":{"rendered":"https:\/\/study.madeeasy.in\/?p=6367"},"modified":"2025-11-13T12:10:35","modified_gmt":"2025-11-13T06:40:35","slug":"queue-and-its-operations","status":"publish","type":"post","link":"https:\/\/www.madeeasy.in\/study\/cs-it\/queue-and-its-operations","title":{"rendered":"Queue and Its Operations"},"content":{"rendered":"<p style=\"text-align: justify;\">\u201cA queue is an ordered list in which all insertions are done from one end called REAR and deletions are made at another end called FRONT.\u201d Queues are sometimes referred to as First In First Out (FIFO) lists.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6382 size-full\" src=\"https:\/\/study.madeeasy.in\/wp-content\/uploads\/2025\/11\/queue.jpg\" alt=\"Queue\" width=\"641\" height=\"138\" srcset=\"https:\/\/www.madeeasy.in\/study\/wp-content\/uploads\/2025\/11\/queue.jpg 641w, https:\/\/www.madeeasy.in\/study\/wp-content\/uploads\/2025\/11\/queue-300x65.jpg 300w\" sizes=\"auto, (max-width: 641px) 100vw, 641px\" \/><\/p>\n<p style=\"text-align: justify;\"><strong> Example:<\/strong><\/p>\n<ul>\n<li style=\"text-align: justify;\">(a) The people waiting in line at a bank cash counter form a queue.<\/li>\n<li style=\"text-align: justify;\">(b) In computer, the jobs waiting in line to use the processor for execution. This queue is called Job Queue.<\/li>\n<\/ul>\n<h2 style=\"text-align: justify;\"><strong> There are two basic queue operations.<\/strong><\/h2>\n<ul style=\"text-align: justify;\">\n<li><strong>Enqueue:<\/strong> Enqueue: Inserts an item\/element at the rear end of the queue. An error occurs if the queue is full.<\/li>\n<li><strong>Dequeue:<\/strong> Removes an item\/element from the front end of the queue and returns it to the user. An error occurs if the queue is empty.<\/li>\n<\/ul>\n<h3 style=\"text-align: justify;\"><strong> Application of queue<\/strong><\/h3>\n<p style=\"text-align: justify;\">Queues remember things in first-in-first-out (FIFO) order. Good for fair (first come first served) ordering of actions.<\/p>\n<ul style=\"text-align: justify;\">\n<li>(a) Scheduling processing of GUI events printing request.<\/li>\n<li>(b) Simulation orders the events models real life queues (e.g. supermarkets checkout, phone calls on hold).<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">\n","protected":false},"excerpt":{"rendered":"<p>\u201cA queue is an ordered list in which all insertions are done from one end called REAR and deletions are<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,94],"tags":[1891,1892,1890],"class_list":["post-6367","post","type-post","status-publish","format-standard","hentry","category-cs-it","category-operating-system","tag-application-of-queue","tag-dequeue","tag-enqueue"],"_links":{"self":[{"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/posts\/6367","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/comments?post=6367"}],"version-history":[{"count":0,"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/posts\/6367\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/media?parent=6367"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/categories?post=6367"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/tags?post=6367"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}