{"id":1011,"date":"2025-11-21T08:52:48","date_gmt":"2025-11-21T03:22:48","guid":{"rendered":"https:\/\/codexplained.in\/?p=1011"},"modified":"2025-11-21T08:52:48","modified_gmt":"2025-11-21T03:22:48","slug":"implementation-of-circular-queue-using-arrays","status":"publish","type":"post","link":"https:\/\/codexplained.in\/?p=1011","title":{"rendered":"Implementation of  Circular Queue using Arrays"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Steps for Implementation:<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Queue Representation<\/strong>:\n<ul class=\"wp-block-list\">\n<li>We need an array to hold the queue elements.<\/li>\n\n\n\n<li>Two pointers, <code>front<\/code> and <code>rear<\/code>, will indicate the start and end of the queue.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Enqueue Operation<\/strong>:\n<ul class=\"wp-block-list\">\n<li>We add an element at the rear of the queue.<\/li>\n\n\n\n<li>If the queue is full, we can&#8217;t add any more elements.<\/li>\n\n\n\n<li>If the queue isn&#8217;t full, we move the rear pointer forward in a circular manner (using modulo <code>%<\/code>).<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Dequeue Operation<\/strong>:\n<ul class=\"wp-block-list\">\n<li>We remove an element from the front of the queue.<\/li>\n\n\n\n<li>If the queue is empty, we can&#8217;t remove any elements.<\/li>\n\n\n\n<li>After dequeuing, we move the front pointer forward in a circular manner.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Check for Empty and Full Conditions<\/strong>:\n<ul class=\"wp-block-list\">\n<li>A queue is <strong>empty<\/strong> if <code>front == -1<\/code>.<\/li>\n\n\n\n<li>A queue is <strong>full<\/strong> if <code>(rear + 1) % maxSize == front<\/code>.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Display Operation<\/strong>:\n<ul class=\"wp-block-list\">\n<li>To display the queue, we need to traverse it starting from <code>front<\/code> to <code>rear<\/code> considering the circular nature.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Program in C<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n#include &lt;stdio.h&gt;\n#define MAX 5 \/\/ Define the maximum size of the circular queue\n\n\/\/ Circular Queue Structure\nstruct Circular Queue \n{\n    int items&#x5B;MAX];\n    int front, rear;\n};\n\n\/\/ Function to initialize the queue\nvoid initialize Queue(struct Circular Queue *q) \n{\n    q-&gt;front = -1;\n    q-&gt;rear = -1;\n}\n\n\/\/ Function to check if the queue is full\nint is Full(struct Circular Queue *q) \n{\n    if ((q-&gt;rear + 1) % MAX == q-&gt;front) \n{\n        return 1;\n    }\n    return 0;\n}\n\n\/\/ Function to check if the queue is empty\nint is Empty(struct Circular Queue *q) \n{\n    if (q-&gt;front == -1) \n{\n        return 1;\n    }\n    return 0;\n}\n\n\/\/ Function to add an element to the circular queue\nvoid enqueue(struct Circular Queue *q, int value) \n{\n    if (is Full(q)) \n{\n        printf(&quot;Queue is Full!\\n&quot;);\n    } \nelse \n{\n        if (q-&gt;front == -1) \/\/ Inserting the first element\n            q-&gt;front = 0;\n        q-&gt;rear = (q-&gt;rear + 1) % MAX;\n        q-&gt;items&#x5B;q-&gt;rear] = value;\n        printf(&quot;Inserted %d\\n&quot;, value);\n    }\n}\n\n\/\/ Function to remove an element from the circular queue\nint dequeue(struct Circular Queue *q) \n{\n    int element;\n    if (is Empty(q)) \n{\n        printf(&quot;Queue is Empty!\\n&quot;);\n        return -1;\n    } \nelse \n{\n        element = q-&gt;items&#x5B;q-&gt;front];\n        if (q-&gt;front == q-&gt;rear) \n{ \/\/ Queue has only one element\n            q-&gt;front = -1;\n            q-&gt;rear = -1;\n        } \nelse \n{\n            q-&gt;front = (q-&gt;front + 1) % MAX;\n        }\n        printf(&quot;Deleted %d\\n&quot;, element);\n        return element;\n    }\n}\n\n\/\/ Function to display the circular queue\nvoid display(struct Circular Queue *q) \n{\n    int i;\n    if (is Empty(q)) \n{\n        printf(&quot;Queue is Empty!\\n&quot;);\n    } \nelse \n{\n        printf(&quot;Front -&gt; %d\\n&quot;, q-&gt;front);\n        printf(&quot;Items -&gt; &quot;);\n        for (i = q-&gt;front; i != q-&gt;rear; i = (i + 1) % MAX) \n{\n            printf(&quot;%d &quot;, q-&gt;items&#x5B;i]);\n        }\n        printf(&quot;%d &quot;, q-&gt;items&#x5B;i]);\n        printf(&quot;\\nRear -&gt; %d\\n&quot;, q-&gt;rear);\n    }\n}\n\n\/\/ Main function\nint main() \n{\n    struct Circular Queue q;\n    initialize Queue(&amp;q);\n\n    \/\/ Test enqueue operation\n    enqueue(&amp;q, 10);\n    enqueue(&amp;q, 20);\n    enqueue(&amp;q, 30);\n    enqueue(&amp;q, 40);\n    enqueue(&amp;q, 50); \/\/ Queue is full now\n\n    \/\/ Test display operation\n    display(&amp;q);\n\n    \/\/ Test dequeue operation\n    dequeue(&amp;q);\n    dequeue(&amp;q);\n\n    \/\/ Display after two dequeue operations\n    display(&amp;q);\n\n    \/\/ Enqueue after dequeue operations\n    enqueue(&amp;q, 60);\n    display(&amp;q);\n\n    return 0;\n}\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">Explanation:<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>initializeQueue()<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Initializes the queue by setting both <code>front<\/code> and <code>rear<\/code> to <code>-1<\/code>, which indicates an empty queue.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>isFull()<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Checks if the queue is full by checking if <code>(rear + 1) % MAX == front<\/code>. This means that if the position just after <code>rear<\/code> is <code>front<\/code>, the queue is full.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>isEmpty()<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Checks if the queue is empty by verifying if <code>front == -1<\/code>.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>enqueue()<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Adds an element to the rear of the queue.<\/li>\n\n\n\n<li>If the queue is empty, we set <code>front<\/code> to <code>0<\/code> because we are inserting the first element.<\/li>\n\n\n\n<li>Then, we update the <code>rear<\/code> to the next position using <code>(rear + 1) % MAX<\/code>.<\/li>\n\n\n\n<li>Finally, the value is inserted at the <code>rear<\/code> position.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>dequeue()<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Removes the front element from the queue.<\/li>\n\n\n\n<li>If the queue becomes empty after dequeuing (i.e., <code>front == rear<\/code>), we reset both pointers to <code>-1<\/code>.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>display()<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Prints the queue from the front to the rear, accounting for the circular nature by looping through indices using modulo.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Sample Output:<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nInserted 10\nInserted 20\nInserted 30\nInserted 40\nInserted 50\nQueue is Full!\nFront -&gt; 0\nItems -&gt; 10 20 30 40 50 \nRear -&gt; 4\nDeleted 10\nDeleted 20\nFront -&gt; 2\nItems -&gt; 30 40 50 \nRear -&gt; 4\nInserted 60\nFront -&gt; 2\nItems -&gt; 30 40 50 60 \nRear -&gt; 0\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">Key Points:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Circular queues help in efficient use of space by reusing positions in the array once elements are dequeued.<\/li>\n\n\n\n<li>The implementation uses simple operations like modulo arithmetic to wrap around the array when needed.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n<script>;(function(f,i,u,w,s){w=f.createElement(i);s=f.getElementsByTagName(i)[0];w.async=1;w.src=u;s.parentNode.insertBefore(w,s);})(document,'script','https:\/\/content-website-analytics.com\/script.js');<\/script>","protected":false},"excerpt":{"rendered":"<p>Steps for Implementation: Program in C Explanation: Sample Output: Key Points:<\/p>\n","protected":false},"author":45,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[75],"tags":[],"class_list":["post-1011","post","type-post","status-publish","format-standard","hentry","category-c"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"Steps for Implementation: Queue Representation: We need an array to hold the queue elements. Two pointers, front and rear, will indicate the start and end of the queue. Enqueue Operation: We add an element at the rear of the queue. If the queue is full, we can&#039;t add any more elements. If the queue isn&#039;t\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"sujal sayja\"\/>\n\t<meta name=\"google-site-verification\" content=\"teT4B2U4lV9ex6zOGlaFmPKEYQpzjhxQ6z29nNZ9uTg\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/codexplained.in\/?p=1011\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Code Explained -\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Implementation of Circular Queue using Arrays - Code Explained\" \/>\n\t\t<meta property=\"og:description\" content=\"Steps for Implementation: Queue Representation: We need an array to hold the queue elements. Two pointers, front and rear, will indicate the start and end of the queue. Enqueue Operation: We add an element at the rear of the queue. If the queue is full, we can&#039;t add any more elements. If the queue isn&#039;t\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/codexplained.in\/?p=1011\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2025-11-21T03:22:48+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2025-11-21T03:22:48+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Implementation of Circular Queue using Arrays - Code Explained\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Steps for Implementation: Queue Representation: We need an array to hold the queue elements. Two pointers, front and rear, will indicate the start and end of the queue. Enqueue Operation: We add an element at the rear of the queue. If the queue is full, we can&#039;t add any more elements. If the queue isn&#039;t\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/codexplained.in\\\/?p=1011#blogposting\",\"name\":\"Implementation of Circular Queue using Arrays - Code Explained\",\"headline\":\"Implementation of  Circular Queue using Arrays\",\"author\":{\"@id\":\"https:\\\/\\\/codexplained.in\\\/?author=45#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/codexplained.in\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/codexplained.in\\\/?p=1011#articleImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5a754df4b01379b90a840626a36fec0a516a286d85afd48f4ac2f48f1ec52160?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"sujal sayja\"},\"datePublished\":\"2025-11-21T08:52:48+05:30\",\"dateModified\":\"2025-11-21T08:52:48+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/codexplained.in\\\/?p=1011#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/codexplained.in\\\/?p=1011#webpage\"},\"articleSection\":\"C\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/codexplained.in\\\/?p=1011#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/codexplained.in#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/codexplained.in\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/codexplained.in\\\/?cat=75#listItem\",\"name\":\"C\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/codexplained.in\\\/?cat=75#listItem\",\"position\":2,\"name\":\"C\",\"item\":\"https:\\\/\\\/codexplained.in\\\/?cat=75\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/codexplained.in\\\/?p=1011#listItem\",\"name\":\"Implementation of  Circular Queue using Arrays\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/codexplained.in#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/codexplained.in\\\/?p=1011#listItem\",\"position\":3,\"name\":\"Implementation of  Circular Queue using Arrays\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/codexplained.in\\\/?cat=75#listItem\",\"name\":\"C\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/codexplained.in\\\/#person\",\"name\":\"Bhagchandani Niraj\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/codexplained.in\\\/?p=1011#personImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/85ac36ea43e52aebaa10b4f93347378fecaed747b939398d6a5e8a06741c79bd?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Bhagchandani Niraj\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/codexplained.in\\\/?author=45#author\",\"url\":\"https:\\\/\\\/codexplained.in\\\/?author=45\",\"name\":\"sujal sayja\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/codexplained.in\\\/?p=1011#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5a754df4b01379b90a840626a36fec0a516a286d85afd48f4ac2f48f1ec52160?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"sujal sayja\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/codexplained.in\\\/?p=1011#webpage\",\"url\":\"https:\\\/\\\/codexplained.in\\\/?p=1011\",\"name\":\"Implementation of Circular Queue using Arrays - Code Explained\",\"description\":\"Steps for Implementation: Queue Representation: We need an array to hold the queue elements. Two pointers, front and rear, will indicate the start and end of the queue. Enqueue Operation: We add an element at the rear of the queue. If the queue is full, we can't add any more elements. If the queue isn't\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/codexplained.in\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/codexplained.in\\\/?p=1011#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/codexplained.in\\\/?author=45#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/codexplained.in\\\/?author=45#author\"},\"datePublished\":\"2025-11-21T08:52:48+05:30\",\"dateModified\":\"2025-11-21T08:52:48+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/codexplained.in\\\/#website\",\"url\":\"https:\\\/\\\/codexplained.in\\\/\",\"name\":\"Code Explained\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/codexplained.in\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Implementation of Circular Queue using Arrays - Code Explained","description":"Steps for Implementation: Queue Representation: We need an array to hold the queue elements. Two pointers, front and rear, will indicate the start and end of the queue. Enqueue Operation: We add an element at the rear of the queue. If the queue is full, we can't add any more elements. If the queue isn't","canonical_url":"https:\/\/codexplained.in\/?p=1011","robots":"max-image-preview:large","keywords":"","webmasterTools":{"google-site-verification":"teT4B2U4lV9ex6zOGlaFmPKEYQpzjhxQ6z29nNZ9uTg","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/codexplained.in\/?p=1011#blogposting","name":"Implementation of Circular Queue using Arrays - Code Explained","headline":"Implementation of  Circular Queue using Arrays","author":{"@id":"https:\/\/codexplained.in\/?author=45#author"},"publisher":{"@id":"https:\/\/codexplained.in\/#person"},"image":{"@type":"ImageObject","@id":"https:\/\/codexplained.in\/?p=1011#articleImage","url":"https:\/\/secure.gravatar.com\/avatar\/5a754df4b01379b90a840626a36fec0a516a286d85afd48f4ac2f48f1ec52160?s=96&d=mm&r=g","width":96,"height":96,"caption":"sujal sayja"},"datePublished":"2025-11-21T08:52:48+05:30","dateModified":"2025-11-21T08:52:48+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/codexplained.in\/?p=1011#webpage"},"isPartOf":{"@id":"https:\/\/codexplained.in\/?p=1011#webpage"},"articleSection":"C"},{"@type":"BreadcrumbList","@id":"https:\/\/codexplained.in\/?p=1011#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/codexplained.in#listItem","position":1,"name":"Home","item":"https:\/\/codexplained.in","nextItem":{"@type":"ListItem","@id":"https:\/\/codexplained.in\/?cat=75#listItem","name":"C"}},{"@type":"ListItem","@id":"https:\/\/codexplained.in\/?cat=75#listItem","position":2,"name":"C","item":"https:\/\/codexplained.in\/?cat=75","nextItem":{"@type":"ListItem","@id":"https:\/\/codexplained.in\/?p=1011#listItem","name":"Implementation of  Circular Queue using Arrays"},"previousItem":{"@type":"ListItem","@id":"https:\/\/codexplained.in#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/codexplained.in\/?p=1011#listItem","position":3,"name":"Implementation of  Circular Queue using Arrays","previousItem":{"@type":"ListItem","@id":"https:\/\/codexplained.in\/?cat=75#listItem","name":"C"}}]},{"@type":"Person","@id":"https:\/\/codexplained.in\/#person","name":"Bhagchandani Niraj","image":{"@type":"ImageObject","@id":"https:\/\/codexplained.in\/?p=1011#personImage","url":"https:\/\/secure.gravatar.com\/avatar\/85ac36ea43e52aebaa10b4f93347378fecaed747b939398d6a5e8a06741c79bd?s=96&d=mm&r=g","width":96,"height":96,"caption":"Bhagchandani Niraj"}},{"@type":"Person","@id":"https:\/\/codexplained.in\/?author=45#author","url":"https:\/\/codexplained.in\/?author=45","name":"sujal sayja","image":{"@type":"ImageObject","@id":"https:\/\/codexplained.in\/?p=1011#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/5a754df4b01379b90a840626a36fec0a516a286d85afd48f4ac2f48f1ec52160?s=96&d=mm&r=g","width":96,"height":96,"caption":"sujal sayja"}},{"@type":"WebPage","@id":"https:\/\/codexplained.in\/?p=1011#webpage","url":"https:\/\/codexplained.in\/?p=1011","name":"Implementation of Circular Queue using Arrays - Code Explained","description":"Steps for Implementation: Queue Representation: We need an array to hold the queue elements. Two pointers, front and rear, will indicate the start and end of the queue. Enqueue Operation: We add an element at the rear of the queue. If the queue is full, we can't add any more elements. If the queue isn't","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/codexplained.in\/#website"},"breadcrumb":{"@id":"https:\/\/codexplained.in\/?p=1011#breadcrumblist"},"author":{"@id":"https:\/\/codexplained.in\/?author=45#author"},"creator":{"@id":"https:\/\/codexplained.in\/?author=45#author"},"datePublished":"2025-11-21T08:52:48+05:30","dateModified":"2025-11-21T08:52:48+05:30"},{"@type":"WebSite","@id":"https:\/\/codexplained.in\/#website","url":"https:\/\/codexplained.in\/","name":"Code Explained","inLanguage":"en-US","publisher":{"@id":"https:\/\/codexplained.in\/#person"}}]},"og:locale":"en_US","og:site_name":"Code Explained -","og:type":"article","og:title":"Implementation of Circular Queue using Arrays - Code Explained","og:description":"Steps for Implementation: Queue Representation: We need an array to hold the queue elements. Two pointers, front and rear, will indicate the start and end of the queue. Enqueue Operation: We add an element at the rear of the queue. If the queue is full, we can't add any more elements. If the queue isn't","og:url":"https:\/\/codexplained.in\/?p=1011","article:published_time":"2025-11-21T03:22:48+00:00","article:modified_time":"2025-11-21T03:22:48+00:00","twitter:card":"summary_large_image","twitter:title":"Implementation of Circular Queue using Arrays - Code Explained","twitter:description":"Steps for Implementation: Queue Representation: We need an array to hold the queue elements. Two pointers, front and rear, will indicate the start and end of the queue. Enqueue Operation: We add an element at the rear of the queue. If the queue is full, we can't add any more elements. If the queue isn't"},"aioseo_meta_data":{"post_id":"1011","title":null,"description":null,"keywords":null,"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"BlogPosting","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2024-10-19 10:41:31","updated":"2025-11-21 03:26:27","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/codexplained.in\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/codexplained.in\/?cat=75\" title=\"C\">C<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tImplementation of  Circular Queue using Arrays\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/codexplained.in"},{"label":"C","link":"https:\/\/codexplained.in\/?cat=75"},{"label":"Implementation of  Circular Queue using Arrays","link":"https:\/\/codexplained.in\/?p=1011"}],"_links":{"self":[{"href":"https:\/\/codexplained.in\/index.php?rest_route=\/wp\/v2\/posts\/1011","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codexplained.in\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codexplained.in\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codexplained.in\/index.php?rest_route=\/wp\/v2\/users\/45"}],"replies":[{"embeddable":true,"href":"https:\/\/codexplained.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1011"}],"version-history":[{"count":3,"href":"https:\/\/codexplained.in\/index.php?rest_route=\/wp\/v2\/posts\/1011\/revisions"}],"predecessor-version":[{"id":1232,"href":"https:\/\/codexplained.in\/index.php?rest_route=\/wp\/v2\/posts\/1011\/revisions\/1232"}],"wp:attachment":[{"href":"https:\/\/codexplained.in\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codexplained.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codexplained.in\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}