<br />
<b>Warning</b>:  Undefined array key "global_protection_id" in <b>/home/wikitechy/public_html/interview-questions/wp-content/plugins/content-protector/inc/class-ps-rest-handler.php</b> on line <b>51</b><br />
{"id":468,"date":"2021-07-13T10:59:15","date_gmt":"2021-07-13T10:59:15","guid":{"rendered":"https:\/\/www.wikitechy.com\/interview-questions\/?p=468"},"modified":"2021-09-17T10:12:14","modified_gmt":"2021-09-17T10:12:14","slug":"the-time-required-to-insert-in-the-queue-is","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/the-time-required-to-insert-in-the-queue-is\/","title":{"rendered":"The time required to insert in the Queue is ?"},"content":{"rendered":"<div class=\"TextHeading\">\n<div class=\"hddn\">\n<h3 id=\"the-time-required-to-insert-in-the-queue-is\" class=\"color-pink\">The time required to insert in the Queue is ?<\/h3>\n<div class=\"row\">\n<div class=\"col-sm-6\">\n<p>A. O(n)<\/p>\n<\/div>\n<div class=\"col-sm-6\">\n<p>B. O(n<sup>2<\/sup>)<\/p>\n<\/div>\n<div class=\"col-sm-6\">\n<p>C. O(1)<\/p>\n<\/div>\n<div class=\"col-sm-6\">\n<p>D. O(log n)<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3 id=\"answer-c-o1\"><b>Answer :\u00a0<\/b>C. O(1)<\/h3>\n<div class=\"subheading\">\n<h2 id=\"explanation\">Explanation :<\/h2>\n<\/div>\n<div class=\"Content\">\n<div class=\"hddn\">\n<ul>\n<li>Queues offer random access to their contents by shifting the first element off the front of the queue. You have to do this repeatedly to access an arbitrary element somewhere in the queue. Therefore, access is O(n).<\/li>\n<li>In the queue only two operations are allowed\u00a0<b>enqueue<\/b>\u00a0and\u00a0<b>dequeue<\/b>.\n<ul>\n<li><b>Enqueue<\/b>\u00a0means to insert an item into the back of the queue.<\/li>\n<li><b>Dequeue<\/b>\u00a0means removing the front item.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"text-center row\"><\/div>\n<div class=\"subheading\">\n<h2 id=\"complexity-analysis-of-queue-operations\" class=\"color-green\">Complexity Analysis of Queue Operations :<\/h2>\n<\/div>\n<div class=\"Content\">\n<div class=\"hddn\">\n<ul>\n<li>Enqueue : O(1)<\/li>\n<li>Dequeue : O(1)<\/li>\n<\/ul>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The time required to insert in the Queue is ?<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"passster_activate_protection":false,"passster_protect_child_pages":"","passster_protection_type":"password","passster_password":"","passster_activate_overwrite_defaults":"","passster_headline":"","passster_instruction":"","passster_placeholder":"","passster_button":"","passster_id":"","passster_activate_misc_settings":"","passster_redirect_url":"","passster_hide":"no","passster_area_shortcode":"","gtb_hide_title":false,"gtb_wrap_title":false,"gtb_class_title":"","gtb_remove_headerfooter":false,"footnotes":""},"categories":[3028],"tags":[195,971,491,221,368,203,199,214,198,363,3057,205,222,484,3054,3148,196,212,16276,207,366,204,3161,3149,3150,3151,206,972,200,3152,3153,3154,3155,3156,3157,3055,3158,197,3147,3159,3160,968,3056,285,969],"class_list":["post-468","post","type-post","status-publish","format-standard","hentry","category-data-structure","tag-accenture-interview-questions-and-answers","tag-altimetrik-india-pvt-ltd-interview-questions-and-answers","tag-applied-materials-interview-questions-and-answers","tag-bharti-airtel-interview-questions-and-answers","tag-bmc-software-interview-questions-and-answers","tag-capgemini-interview-questions-and-answers","tag-casting-networks-india-pvt-limited-interview-questions-and-answers","tag-cgi-group-inc-interview-questions-and-answers","tag-chetu-interview-questions-and-answers","tag-ciena-corporation-interview-questions-and-answers","tag-collabera-te-interview-questions-and-answers","tag-dell-international-services-india-pvt-ltd-interview-questions-and-answers","tag-flipkart-interview-questions-and-answers","tag-genpact-interview-questions-and-answers","tag-globallogic-india-pvt-ltd-interview-questions-and-answers","tag-how-is-inserting-into-a-linked-list-o1","tag-ibm-interview-questions-and-answers","tag-indecomm-global-services-interview-questions-and-answers","tag-most-asked-sapient-nitro-interview-questions","tag-mphasis-interview-questions-and-answers","tag-netapp-interview-questions-and-answers","tag-oracle-corporation-interview-questions-and-answers","tag-queue-using-linked-list","tag-queue-using-linked-list-algorithm","tag-queue-using-linked-list-c","tag-queue-using-linked-list-in-c","tag-sap-labs-india-pvt-ltd-interview-questions-and-answers","tag-sapient-consulting-pvt-ltd-interview-questions-and-answers","tag-tech-mahindra-interview-questions-and-answers","tag-the-time-required-to-insert-in-the-queue","tag-time-complexity-of-circular-queue","tag-time-complexity-of-enqueue-and-dequeue","tag-time-complexity-of-queue-using-array","tag-time-complexity-of-queue-using-linked-list","tag-time-taken-for-addition-of-element-in-queue-is","tag-tracxn-technologies-pvt-ltd-interview-questions-and-answers","tag-types-of-queue-in-data-structure","tag-unitedhealth-group-interview-questions-and-answers","tag-what-are-the-time-complexities-of-various-data","tag-what-will-be-the-time-complexity-of-insertion","tag-what-will-be-the-time-complexity-of-insertion-in-queue","tag-wipro-infotech-interview-questions-and-answers","tag-wm-global-technology-services-india-pvt-ltd-limited-wmgts-interview-questions-and-answers","tag-xoriant-solutions-pvt-ltd-interview-questions-and-answers","tag-yodlee-infotech-pvt-ltd-interview-questions-and-answers"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>The time required to insert in the Queue is ? - Data Structure<\/title>\n<meta name=\"description\" content=\"The time required to insert in the Queue is - Queues offer random access to their contents by shifting the first element off the front of the queue.\" \/>\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.wikitechy.com\/interview-questions\/data-structure\/the-time-required-to-insert-in-the-queue-is\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The time required to insert in the Queue is ? - Data Structure\" \/>\n<meta property=\"og:description\" content=\"The time required to insert in the Queue is - Queues offer random access to their contents by shifting the first element off the front of the queue.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/the-time-required-to-insert-in-the-queue-is\/\" \/>\n<meta property=\"og:site_name\" content=\"Wikitechy\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-13T10:59:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-17T10:12:14+00:00\" \/>\n<meta name=\"author\" content=\"Editor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Editor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/the-time-required-to-insert-in-the-queue-is\/\",\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/the-time-required-to-insert-in-the-queue-is\/\",\"name\":\"The time required to insert in the Queue is ? - Data Structure\",\"isPartOf\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#website\"},\"datePublished\":\"2021-07-13T10:59:15+00:00\",\"dateModified\":\"2021-09-17T10:12:14+00:00\",\"author\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757\"},\"description\":\"The time required to insert in the Queue is - Queues offer random access to their contents by shifting the first element off the front of the queue.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/the-time-required-to-insert-in-the-queue-is\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#website\",\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/\",\"name\":\"Wikitechy\",\"description\":\"Interview Questions\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wikitechy.com\/interview-questions\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757\",\"name\":\"Editor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g\",\"caption\":\"Editor\"},\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/author\/editor\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"The time required to insert in the Queue is ? - Data Structure","description":"The time required to insert in the Queue is - Queues offer random access to their contents by shifting the first element off the front of the queue.","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.wikitechy.com\/interview-questions\/data-structure\/the-time-required-to-insert-in-the-queue-is\/","og_locale":"en_US","og_type":"article","og_title":"The time required to insert in the Queue is ? - Data Structure","og_description":"The time required to insert in the Queue is - Queues offer random access to their contents by shifting the first element off the front of the queue.","og_url":"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/the-time-required-to-insert-in-the-queue-is\/","og_site_name":"Wikitechy","article_published_time":"2021-07-13T10:59:15+00:00","article_modified_time":"2021-09-17T10:12:14+00:00","author":"Editor","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Editor","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/the-time-required-to-insert-in-the-queue-is\/","url":"https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/the-time-required-to-insert-in-the-queue-is\/","name":"The time required to insert in the Queue is ? - Data Structure","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website"},"datePublished":"2021-07-13T10:59:15+00:00","dateModified":"2021-09-17T10:12:14+00:00","author":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757"},"description":"The time required to insert in the Queue is - Queues offer random access to their contents by shifting the first element off the front of the queue.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wikitechy.com\/interview-questions\/data-structure\/the-time-required-to-insert-in-the-queue-is\/"]}]},{"@type":"WebSite","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website","url":"https:\/\/www.wikitechy.com\/interview-questions\/","name":"Wikitechy","description":"Interview Questions","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wikitechy.com\/interview-questions\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757","name":"Editor","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g","caption":"Editor"},"url":"https:\/\/www.wikitechy.com\/interview-questions\/author\/editor\/"}]}},"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/comments?post=468"}],"version-history":[{"count":2,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/468\/revisions"}],"predecessor-version":[{"id":3535,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/468\/revisions\/3535"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/media?parent=468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/categories?post=468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/tags?post=468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}