{"id":26174,"date":"2021-02-28T23:52:00","date_gmt":"2021-02-28T18:22:00","guid":{"rendered":"https:\/\/www.mygreatlearning.com\/blog\/priority-queue-in-cpp\/"},"modified":"2024-09-03T11:08:30","modified_gmt":"2024-09-03T05:38:30","slug":"priority-queue-in-cpp","status":"publish","type":"post","link":"https:\/\/www.mygreatlearning.com\/blog\/priority-queue-in-cpp\/","title":{"rendered":"Priority Queue in C++"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\" id=\"contents\"><strong>Contents<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"#what-is-a-priority-queue-in-C++\">What is Priority Queue in C++?<\/a><\/li>\n\n\n\n<li><a href=\"#difference-between-a-queue-and-priority-queue\">Difference between Priority Queue and Queue<\/a><\/li>\n\n\n\n<li><a href=\"#syntax\">Syntax of Priority Queue<\/a><\/li>\n\n\n\n<li><a href=\"#min-heap\">Syntax to create min-heap for Priority Queue<\/a><\/li>\n\n\n\n<li><a href=\"#how-does-c++-priority-queue-work\">How does c++ Priority Queue work?<\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#inserting-elements\">Inserting elements<\/a><\/li>\n\n\n\n<li><a href=\"#accessing elements\">Accessing ele<\/a><a href=\"#accessing-elements\">m<\/a><a href=\"#accessing elements\">ents<\/a><\/li>\n\n\n\n<li><a href=\"#deleting-elements\">Deleting elements<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>&nbsp;<a href=\"#C++-priority-queue-methods\">C++ Priority Queue Methods<\/a><\/li>\n\n\n\n<li>&nbsp;<a href=\"#simple-programs-of-priority-queue\">Simple programs of Priority Queue<\/a><\/li>\n\n\n\n<li>&nbsp;<a href=\"#conclusion\">Conclusion<\/a><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-a-priority-queue-in-c\"><strong>What is a Priority Queue in C++?<\/strong><\/h2>\n\n\n\n<p>A&nbsp; priority queue in c++ is a type of container adapter, which processes only the highest priority element, i.e. the first element will be the maximum of all elements in the queue, and elements are in decreasing order.<\/p>\n\n\n\n    <div class=\"courses-cta-container\">\n        <div class=\"courses-cta-card\">\n            <div class=\"courses-cta-header\">\n                <div class=\"courses-learn-icon\"><\/div>\n                <span class=\"courses-learn-text\">Academy Pro<\/span>\n            <\/div>\n            <p class=\"courses-cta-title\">\n                <a href=\"https:\/\/www.mygreatlearning.com\/academy\/premium\/learn-c-programming-for-beginners-to-advanced\" class=\"courses-cta-title-link\">C++ Programming Course<\/a>\n            <\/p>\n            <p class=\"courses-cta-description\">Master key C++ programming concepts like variables, functions, OOP, and control structures. Build real-world projects such as a banking system and grade management tool.<\/p>\n            <div class=\"courses-cta-stats\">\n                <div class=\"courses-stat-item\">\n                    <div class=\"courses-stat-icon courses-user-icon\"><\/div>\n                    <span>Beginner to Advanced Level<\/span>\n                <\/div>\n                <div class=\"courses-stat-item\">\n                    <div class=\"courses-stat-icon courses-star-icon\"><\/div>\n                    <span>8.1 hrs<\/span>\n                <\/div>\n            <\/div>\n            <a href=\"https:\/\/www.mygreatlearning.com\/academy\/premium\/learn-c-programming-for-beginners-to-advanced\" class=\"courses-cta-button\">\n                Start Free Trial\n                <div class=\"courses-arrow-icon\"><\/div>\n            <\/a>\n        <\/div>\n    <\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"difference-between-a-queue-and-a-priority-queue\"><strong>Difference between a queue and a priority queue:<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Priority Queue<\/td><td>Queue<\/td><\/tr><tr><td>Priority Queue container processes the element with the highest priority, whereas no priority exists in a queue.<\/td><td>The queue follows First-in-First-out (FIFO) rule, but in the priority queue highest priority element will be deleted first.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If more than one element exists with the same priority, then, in this case, the order of queue will be taken.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"syntax-of-priority-queue\"><strong>Syntax of Priority Queue:<\/strong><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\u00a0\u00a0priority_queue&amp;lt;int&gt; variableName;\u00a0\u00a0\u00a0\n<\/pre><\/div>\n\n\n<p><strong>Note<\/strong>:&nbsp; By default, C++ creates a max-heap for the priority queue.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"syntax-to-create-min-heap-for-the-priority-queue\"><strong>Syntax to create min-heap for the Priority&nbsp;Queue:<\/strong><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\u00a0\u00a0priority_queue &amp;lt;int, vector&amp;lt;int&gt;, greater&amp;lt;int&gt;&gt; q;\u00a0\n<\/pre><\/div>\n\n\n<p>Where vector&lt;int&gt; is a STL container and greater&lt;int&gt; is comparator class.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how-does-c-priority-queue-work\"><strong>How does c++ Priority Queue work?<\/strong><\/h3>\n\n\n\n<p>Priority Queue considers only the highest priority element.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"inserting-elements-in-a-priority-queue\">Inserting elements in a Priority Queue:<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/* Program to insert elements in a queue*\/\n\n#include&amp;lt;iostream&gt;\n#include&amp;lt;queue&gt;            \/\/Header-file for queue\nusing namespace std;\n\nint main()\n{\npriority_queue&amp;lt;int&gt; p1;\np1.push(35);              \/\/ inserting element in a queue\np1.push(40);\np1.push(95);\nwhile (!p1.empty())\n{\ncout &amp;lt;&amp;lt; &#039; &#039; &amp;lt;&amp;lt; p1.top();  \/\/printing elements of queue\np1.pop();\n}\n}\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"accessing-elements-in-a-priority-queue\">Accessing elements in a Priority Queue:<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/* Program to access an element of highest priority *\/\n\n#include&amp;lt;iostream&gt;\n#include&amp;lt;queue&gt;     \/\/Header-file for queue\nusing namespace std;\n\n\nint main()\n{\npriority_queue&amp;lt;int&gt; p1;\np1.push(35);    \np1.push(40);\np1.push(95);\np1.push(25);\n \ncout&amp;lt;&amp;lt;p1.top();      \/\/fetch element of highest\npriority(maximum element) i.e 95\n}\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"deleting-elements-in-a-priority-queue\">Deleting elements in a Priority Queue:<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/* Program to delete elements in a queue*\/\n\n#include&amp;lt;iostream&gt;\n#include&amp;lt;queue&gt;     \/\/Header-file for queue\nusing namespace std;\n\nint main()\n{\npriority_queue&amp;lt;int&gt; p1;\np1.push(35);    \np1.push(40);\np1.push(95);\np1.push(20);\n\/\/ queue : 95 40 35 20\n \np1.pop();            \/\/ queue :  40 35 20\np1.pop();           \/\/ queue :  35  20\n\nwhile (!p1.empty())\n  {\n        cout &amp;lt;&amp;lt; &#039; &#039; &amp;lt;&amp;lt; p1.top();                \n        p1.pop();\n    }\n   \n}\n\n<\/pre><\/div>\n\n\n<div class=\"topics\" style=\"background:#f6f7f8\">\n\t<div class=\"site-container\">\n\t\t<h2 class=\"section-title\" class=\"section-title\" id=\"learn-more-c-concepts\"> Learn More C++ Concepts <\/h2>\t\n\t\t<div class=\"topic-wrapper\">\n\t\t\t\t\t\t<a class=\"card\" href=\"https:\/\/www.mygreatlearning.com\/academy\/learn-for-free\/courses\/oops-concepts-in-c\" target=\"_blank\"> OOPs Concepts in C++ Free Course <\/a>\n\t\t\t\t\t\t<a class=\"card\" href=\"https:\/\/www.mygreatlearning.com\/academy\/learn-for-free\/courses\/c-for-beginners1\" target=\"_blank\"> C For Beginners Free Course <\/a>\n\t\t\t\t\t\t<a class=\"card\" href=\"https:\/\/www.mygreatlearning.com\/academy\/learn-for-free\/courses\/turbo-c\" target=\"_blank\"> Turbo C++ Free Course <\/a>\n\t\t\t\t\t\t<a class=\"card\" href=\"https:\/\/www.mygreatlearning.com\/academy\/learn-for-free\/courses\/c-tutorial\" target=\"_blank\"> C++ Tutorial Free Course <\/a>\n\t\t\t\t\t<\/div>\n\t<\/div>\n<\/div>\n\n\n\n\n<h2 class=\"wp-block-heading\" id=\"c-priority-queue-methods\"><strong>C++ Priority Queue Methods<br><\/strong><\/h2>\n\n\n\n<p>Following are the C++ Priority Queue Methods :<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Methods<\/td><td>Description<\/td><\/tr><tr><td>empty()<\/td><td>This method checks whether the priority_queue container is empty or not. If it is empty, return true, else false. It does not take any parameters. <br>syntax&nbsp; : &nbsp; p1.empty() &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ p1 is priority_queue object<\/td><\/tr><tr><td>size()<\/td><td>This method gives the number of elements in the priority queue container. It returns the size in an integer. It does not take any parameter.<br>syntax : &nbsp; p2.size() &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;<em>&nbsp;\/\/ p2 is priority_queue object<\/em><\/td><\/tr><tr><td>push()<\/td><td>This method inserts the element into the queue. Firstly, the element is added to the end of the queue, and simultaneously elements reorder themselves with priority. It takes value in the parameter.<br>syntax :&nbsp; p3.push(value)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <em>\/\/value to be inserted<\/em><\/td><\/tr><tr><td>pop()<\/td><td>This method&nbsp; delete the top element (highest priority) from the priority_queue. It does not take any parameter.<br>syntax :&nbsp; p3.pop() &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ p3 is priority_queue object<\/td><\/tr><tr><td>top()<\/td><td>This method gives the top element from the priority queue container. It does not take any parameter.<br>syntax :&nbsp; p3.top()&nbsp;&nbsp;<\/td><\/tr><tr><td>swap()<\/td><td>This method swaps the elements of a priority_queue with another priority_queue of the same size and type. It takes the priority queue in a parameter whose values need to be swapped.<br>syntax :&nbsp; p3.swap(p1)&nbsp;&nbsp;&nbsp;<\/td><\/tr><tr><td>emplace()<\/td><td>This method adds a new element in a container at the top of the priority queue. It takes value in a parameter.<br>syntax :&nbsp; p3.emplace(value)&nbsp; &nbsp;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Lets see the above methods&nbsp; with a&nbsp; simple program :<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"a-program-to-show-size-and-empty-method\">A <strong>Program to show size and empty method:<\/strong><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n#include&amp;lt;iostream&gt;\n#include&amp;lt;queue&gt;         \/\/Header-file for queue\nusing namespace std;\nint main()\n{\npriority_queue&amp;lt;int&gt; q1;\n\t\nq1.push(25);          \/\/add 25 in a queue\nq1.push(15);    \nq1.push(30);    \nq1.push(76);    \nq1.push(85);    \n\t             \/\/ queue : 85 76 30 25 15\n\ncout&amp;lt;&amp;lt;&quot; Number of elements in a priority queue : &quot;&amp;lt;&amp;lt;q1.size()&amp;lt;&amp;lt;endl;\n\t\ncout&amp;lt;&amp;lt;&quot; The top element is : &quot;&amp;lt;&amp;lt;q1.top()&amp;lt;&amp;lt;endl;       \/\/return the maximum element from the queue;\n\t\nq1.pop();        \/\/remove the highest priority element(MAX element) from the queue;\n\n\t            \/\/ queue : 76 30 25 15\n\nq1.push(55);\nq1.push(89);\nq1.push(35);\ncout&amp;lt;&amp;lt;&quot; After Inserting : &quot;&amp;lt;&amp;lt;endl;\n\t            \/\/queue : 89 76 55 35 30 25 15\n\t \nwhile(!q1.empty())\n\t {\n\t \tcout&amp;lt;&amp;lt;&quot; &quot;&amp;lt;&amp;lt;q1.top()&amp;lt;&amp;lt;&quot; &quot;;\n\t \tq1.pop();\n\t }\n}\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"program-of-swap-method\"><strong>Program of swap method :&nbsp;<\/strong><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n#include &amp;lt;iostream&gt;  \n#include &amp;lt;queue&gt;  \nusing namespace std;  \nint main()  \n{   \npriority_queue&amp;lt;int&gt; p1,q1; \n \n\/\/pushing value in p1.  \np1.push(28);  \np1.push(69);  \np1.push(36);  \np1.push(23);  \np1.push(14);  \n\n\/\/pushing value in q1.  \nq1.push(10);  \nq1.push(80);  \nq1.push(32);  \nq1.push(20);  \nq1.push(15);  \n\np1.swap(q1);  \ncout&amp;lt;&amp;lt; &quot;elements in p1 : &quot;; \n \nwhile(!p1.empty())  \n{  \n\ncout&amp;lt;&amp;lt;&quot; &quot;&amp;lt;&amp;lt;p1.top() &amp;lt;&amp;lt;&#039; &#039;;  \np1.pop();\n  \n} \n \ncout&amp;lt;&amp;lt; &#039;\\n&#039;;  \ncout&amp;lt;&amp;lt; &quot;elements in m1 : &quot;;  \nwhile(!q1.empty())  \n{\n  \ncout&amp;lt;&amp;lt;&quot; &quot;&amp;lt;&amp;lt;q1.top() &amp;lt;&amp;lt; &#039; &#039;;  \nq1.pop();  \n\n    }  \nreturn 0;\n  \n} \n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"a-program-of-embrace-method\">A <strong>Program of embrace method :<\/strong><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n#include&amp;lt;iostream&gt;\n#include&amp;lt;queue&gt;     \/\/Header-file for queue\n#include&amp;lt;string&gt;\nusing namespace std;\nint main()\n{\n\tpriority_queue&amp;lt;string&gt; q1;\n\tq1.emplace(&quot;Ankit&quot;);\n\tq1.emplace(&quot;Ved&quot;);\n\tq1.emplace(&quot;Nikita&quot;);\n\tq1.emplace(&quot;Shaurya&quot;);\n\tq1.emplace(&quot;Anokhi&quot;);\n\t\n\t \/\/ queue: Ved Shaurya Nikita Anokhi Ankit\nt\n\t \n\twhile (!q1.empty())  \n {  \n\n        cout&amp;lt;&amp;lt;&quot; &quot;&amp;lt;&amp;lt;q1.top() &amp;lt;&amp;lt; &quot; &quot;;  \n        q1.pop(); \n \n}   \nreturn 0;\n\t\n\t\n}\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"c-program-to-implement-min-heap\"><strong>C++ Program to implement min-heap :&nbsp;<\/strong><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n#include&amp;lt;iostream&gt;\n#include&amp;lt;queue&gt;     \/\/Header-file for queue\n\nusing namespace std;\nint main()\n{\n\t \/\/ creates a min heap\npriority_queue &amp;lt;int, vector&amp;lt;int&gt;, greater&amp;lt;int&gt; &gt; p1;\n\n    p1.push(55);\n    p1.push(1);\n    p1.push(76);\n    p1.push(39);\n    p1.push(23);\n    p1.push(49);\n    p1.push(32);\n\t \n\t while (!p1.empty())\n    {\n        cout &amp;lt;&amp;lt;&quot;  &quot;&amp;lt;&amp;lt; p1.top() &amp;lt;&amp;lt; &quot; &quot;;\n        p1.pop();\n    }\n \n    return 0;\t\n}\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>Therefore, Priority Queue is a container that stores elements with priority. Unlike queues, which insert or delete the element based on the FIFO rule, in Priority Queue, elements are removed based on priority. The element with the highest priority is the first one to be removed from the queue.<\/p>\n\n\n\n<p>Priority queue supports three operations: <strong>is_empty<\/strong> to check if there is no element in the queue,<strong>insert_with_priority<\/strong>, to add an element with priority, and <strong>Pull_highest_priority_element<\/strong>, to fetch element of highest priority in the queue and show it.<\/p>\n\n\n\n<p>The importance of the priority queue is to process the elements based on priority.<\/p>\n\n\n\n<p>This brings us to the end of the blog on the concept of Priority Queue in C++. We hope that you found this comprehensive and helpful and were able to gain the required knowledge. If you wish to up-skill and learn more such concepts, you can&nbsp;<a href=\"https:\/\/www.mygreatlearning.com\/academy\" target=\"_blank\" rel=\"noreferrer noopener\">check out the pool of Free online courses on Great Learning Academy.<\/a><\/p>\n\n\n\n<p>Also, if you are preparing for Interviews, check out these&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/www.mygreatlearning.com\/blog\/cpp-interview-questions\/\" target=\"_blank\">Interview Questions for C++<\/a>&nbsp;to ace it like a pro.<\/p>\n\n\n\n<p><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Contents What is a Priority Queue in C++? A&nbsp; priority queue in c++ is a type of container adapter, which processes only the highest priority element, i.e. the first element will be the maximum of all elements in the queue, and elements are in decreasing order. Difference between a queue and a priority queue: Priority [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":26189,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[25860],"tags":[],"content_type":[],"class_list":["post-26174","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Priority Queue in C++ | Everything you need to know about Priority Queues<\/title>\n<meta name=\"description\" content=\"A priority queue in c++ is a type of container adapter, which processes only the highest priority element in a queue and sorts accordingly.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mygreatlearning.com\/blog\/priority-queue-in-cpp\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Priority Queue in C++\" \/>\n<meta property=\"og:description\" content=\"A priority queue in c++ is a type of container adapter, which processes only the highest priority element in a queue and sorts accordingly.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mygreatlearning.com\/blog\/priority-queue-in-cpp\/\" \/>\n<meta property=\"og:site_name\" content=\"Great Learning Blog: Free Resources what Matters to shape your Career!\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/GreatLearningOfficial\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-28T18:22:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-03T05:38:30+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/02\/shutterstock_1183376491.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"667\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Great Learning Editorial Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/Great_Learning\" \/>\n<meta name=\"twitter:site\" content=\"@Great_Learning\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Great Learning Editorial Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/priority-queue-in-cpp\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/priority-queue-in-cpp\\\/\"},\"author\":{\"name\":\"Great Learning Editorial Team\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\"},\"headline\":\"Priority Queue in C++\",\"datePublished\":\"2021-02-28T18:22:00+00:00\",\"dateModified\":\"2024-09-03T05:38:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/priority-queue-in-cpp\\\/\"},\"wordCount\":758,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/priority-queue-in-cpp\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/shutterstock_1183376491.jpg\",\"articleSection\":[\"IT\\\/Software Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/priority-queue-in-cpp\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/priority-queue-in-cpp\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/priority-queue-in-cpp\\\/\",\"name\":\"Priority Queue in C++ | Everything you need to know about Priority Queues\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/priority-queue-in-cpp\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/priority-queue-in-cpp\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/shutterstock_1183376491.jpg\",\"datePublished\":\"2021-02-28T18:22:00+00:00\",\"dateModified\":\"2024-09-03T05:38:30+00:00\",\"description\":\"A priority queue in c++ is a type of container adapter, which processes only the highest priority element in a queue and sorts accordingly.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/priority-queue-in-cpp\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/priority-queue-in-cpp\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/priority-queue-in-cpp\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/shutterstock_1183376491.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/shutterstock_1183376491.jpg\",\"width\":1000,\"height\":667,\"caption\":\"Priority Queue in C++\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/priority-queue-in-cpp\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"IT\\\/Software Development\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/software\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Priority Queue in C++\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"name\":\"Great Learning Blog\",\"description\":\"Learn, Upskill &amp; Career Development Guide and Resources\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"alternateName\":\"Great Learning\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\",\"name\":\"Great Learning\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"width\":900,\"height\":900,\"caption\":\"Great Learning\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/GreatLearningOfficial\\\/\",\"https:\\\/\\\/x.com\\\/Great_Learning\",\"https:\\\/\\\/www.instagram.com\\\/greatlearningofficial\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/in.pinterest.com\\\/greatlearning12\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/beaconelearning\\\/\"],\"description\":\"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.\",\"email\":\"info@mygreatlearning.com\",\"legalName\":\"Great Learning Education Services Pvt. Ltd\",\"foundingDate\":\"2013-11-29\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"1001\",\"maxValue\":\"5000\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\",\"name\":\"Great Learning Editorial Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"caption\":\"Great Learning Editorial Team\"},\"description\":\"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.\",\"sameAs\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/\",\"https:\\\/\\\/in.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/Great_Learning\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCObs0kLIrDjX2LLSybqNaEA\"],\"award\":[\"Best EdTech Company of the Year 2024\",\"Education Economictimes Outstanding Education\\\/Edtech Solution Provider of the Year 2024\",\"Leading E-learning Platform 2024\"],\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/author\\\/greatlearning\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Priority Queue in C++ | Everything you need to know about Priority Queues","description":"A priority queue in c++ is a type of container adapter, which processes only the highest priority element in a queue and sorts accordingly.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.mygreatlearning.com\/blog\/priority-queue-in-cpp\/","og_locale":"en_US","og_type":"article","og_title":"Priority Queue in C++","og_description":"A priority queue in c++ is a type of container adapter, which processes only the highest priority element in a queue and sorts accordingly.","og_url":"https:\/\/www.mygreatlearning.com\/blog\/priority-queue-in-cpp\/","og_site_name":"Great Learning Blog: Free Resources what Matters to shape your Career!","article_publisher":"https:\/\/www.facebook.com\/GreatLearningOfficial\/","article_published_time":"2021-02-28T18:22:00+00:00","article_modified_time":"2024-09-03T05:38:30+00:00","og_image":[{"width":1000,"height":667,"url":"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/02\/shutterstock_1183376491.jpg","type":"image\/jpeg"}],"author":"Great Learning Editorial Team","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/Great_Learning","twitter_site":"@Great_Learning","twitter_misc":{"Written by":"Great Learning Editorial Team","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mygreatlearning.com\/blog\/priority-queue-in-cpp\/#article","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/priority-queue-in-cpp\/"},"author":{"name":"Great Learning Editorial Team","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad"},"headline":"Priority Queue in C++","datePublished":"2021-02-28T18:22:00+00:00","dateModified":"2024-09-03T05:38:30+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/priority-queue-in-cpp\/"},"wordCount":758,"commentCount":0,"publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/priority-queue-in-cpp\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/02\/shutterstock_1183376491.jpg","articleSection":["IT\/Software Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.mygreatlearning.com\/blog\/priority-queue-in-cpp\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.mygreatlearning.com\/blog\/priority-queue-in-cpp\/","url":"https:\/\/www.mygreatlearning.com\/blog\/priority-queue-in-cpp\/","name":"Priority Queue in C++ | Everything you need to know about Priority Queues","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/priority-queue-in-cpp\/#primaryimage"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/priority-queue-in-cpp\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/02\/shutterstock_1183376491.jpg","datePublished":"2021-02-28T18:22:00+00:00","dateModified":"2024-09-03T05:38:30+00:00","description":"A priority queue in c++ is a type of container adapter, which processes only the highest priority element in a queue and sorts accordingly.","breadcrumb":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/priority-queue-in-cpp\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mygreatlearning.com\/blog\/priority-queue-in-cpp\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/priority-queue-in-cpp\/#primaryimage","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/02\/shutterstock_1183376491.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/02\/shutterstock_1183376491.jpg","width":1000,"height":667,"caption":"Priority Queue in C++"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mygreatlearning.com\/blog\/priority-queue-in-cpp\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/www.mygreatlearning.com\/blog\/"},{"@type":"ListItem","position":2,"name":"IT\/Software Development","item":"https:\/\/www.mygreatlearning.com\/blog\/software\/"},{"@type":"ListItem","position":3,"name":"Priority Queue in C++"}]},{"@type":"WebSite","@id":"https:\/\/www.mygreatlearning.com\/blog\/#website","url":"https:\/\/www.mygreatlearning.com\/blog\/","name":"Great Learning Blog","description":"Learn, Upskill &amp; Career Development Guide and Resources","publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"alternateName":"Great Learning","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mygreatlearning.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization","name":"Great Learning","url":"https:\/\/www.mygreatlearning.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","width":900,"height":900,"caption":"Great Learning"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/GreatLearningOfficial\/","https:\/\/x.com\/Great_Learning","https:\/\/www.instagram.com\/greatlearningofficial\/","https:\/\/www.linkedin.com\/school\/great-learning\/","https:\/\/in.pinterest.com\/greatlearning12\/","https:\/\/www.youtube.com\/user\/beaconelearning\/"],"description":"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.","email":"info@mygreatlearning.com","legalName":"Great Learning Education Services Pvt. Ltd","foundingDate":"2013-11-29","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"1001","maxValue":"5000"}},{"@type":"Person","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad","name":"Great Learning Editorial Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","caption":"Great Learning Editorial Team"},"description":"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.","sameAs":["https:\/\/www.mygreatlearning.com\/","https:\/\/in.linkedin.com\/school\/great-learning\/","https:\/\/x.com\/https:\/\/twitter.com\/Great_Learning","https:\/\/www.youtube.com\/channel\/UCObs0kLIrDjX2LLSybqNaEA"],"award":["Best EdTech Company of the Year 2024","Education Economictimes Outstanding Education\/Edtech Solution Provider of the Year 2024","Leading E-learning Platform 2024"],"url":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"}]}},"uagb_featured_image_src":{"full":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/02\/shutterstock_1183376491.jpg",1000,667,false],"thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/02\/shutterstock_1183376491-150x150.jpg",150,150,true],"medium":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/02\/shutterstock_1183376491-300x200.jpg",300,200,true],"medium_large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/02\/shutterstock_1183376491-768x512.jpg",768,512,true],"large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/02\/shutterstock_1183376491.jpg",1000,667,false],"1536x1536":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/02\/shutterstock_1183376491.jpg",1000,667,false],"2048x2048":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/02\/shutterstock_1183376491.jpg",1000,667,false],"web-stories-poster-portrait":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/02\/shutterstock_1183376491.jpg",640,427,false],"web-stories-publisher-logo":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/02\/shutterstock_1183376491.jpg",96,64,false],"web-stories-thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2021\/02\/shutterstock_1183376491.jpg",150,100,false]},"uagb_author_info":{"display_name":"Great Learning Editorial Team","author_link":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"},"uagb_comment_info":0,"uagb_excerpt":"Contents What is a Priority Queue in C++? A&nbsp; priority queue in c++ is a type of container adapter, which processes only the highest priority element, i.e. the first element will be the maximum of all elements in the queue, and elements are in decreasing order. Difference between a queue and a priority queue: Priority&hellip;","_links":{"self":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/26174","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/comments?post=26174"}],"version-history":[{"count":33,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/26174\/revisions"}],"predecessor-version":[{"id":111524,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/26174\/revisions\/111524"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media\/26189"}],"wp:attachment":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media?parent=26174"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/categories?post=26174"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/tags?post=26174"},{"taxonomy":"content_type","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/content_type?post=26174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}