{"id":7443,"date":"2022-10-13T13:45:15","date_gmt":"2022-10-13T08:15:15","guid":{"rendered":"https:\/\/www.innovationm.com\/blog\/?p=7443"},"modified":"2022-10-13T13:45:15","modified_gmt":"2022-10-13T08:15:15","slug":"blog-on-time-complexity-of-algorithm","status":"publish","type":"post","link":"https:\/\/www.innovationm.com\/blog\/blog-on-time-complexity-of-algorithm\/","title":{"rendered":"BLOG ON TIME COMPLEXITY OF ALGORITHM"},"content":{"rendered":"<p><strong>What is Time Complexity?<\/strong><\/p>\n<p>Time Complexity is the time consumed by the algorithm to complete its execution. Time Complexity is measured by summing the time of all the elementary operations. There are many notations to represent the time complexity like:-<\/p>\n<p>(1)Big Oh, <strong>O<\/strong><\/p>\n<p>(2)Omega, <strong>\u03a9<\/strong><\/p>\n<p>(3)Theta<strong>, <\/strong><strong>\u0398<\/strong><\/p>\n<p>But, the most commonly used notation for Time Complexity is <strong>Big O Notation. <\/strong>It is nothing but an asymptotic notation to represent the time complexity of an algorithm. There are three types of Time Complexity:-<\/p>\n<ol>\n<li>Worst Case Time Complexity<\/li>\n<li>Best Case Time Complexity<\/li>\n<li>Average Case Time Complexity<\/li>\n<\/ol>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone  wp-image-7444\" src=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/b1-1-300x200.png\" alt=\"\" width=\"353\" height=\"235\" srcset=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/b1-1-300x200.png 300w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/b1-1-1024x682.png 1024w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/b1-1-768x511.png 768w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/b1-1-624x415.png 624w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/b1-1.png 1262w\" sizes=\"(max-width: 353px) 100vw, 353px\" \/><\/p>\n<p><strong>BIG O NOTATION: <\/strong>Big O Notation is used for the measurement of the complete execution of the algorithm. And basically, it represents the worst-case time complexity. Bog O Notation gives the upper limit of a given function and is described as f(n)=O(g(n)).<\/p>\n<p><img decoding=\"async\" class=\"alignnone  wp-image-7445\" src=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/b2-1-300x191.png\" alt=\"\" width=\"368\" height=\"234\" srcset=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/b2-1-300x191.png 300w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/b2-1-624x396.png 624w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/b2-1.png 661w\" sizes=\"(max-width: 368px) 100vw, 368px\" \/><\/p>\n<p>Here we can see that n&#8217; is an intersection point of both the graph f(n) and c*g(n). And f(n) = O(g(n)) means there exists some positive constants c and n&#8217;\u00a0 so that\u00a0 0&lt;=f(n)&lt;=c*g(n) for all n&gt;=n&#8217;.<\/p>\n<p><strong>Now<\/strong>, we have to analyze the rate of growth of some elementary functions and some derived functions:-<\/p>\n<p>&#8212;&#8212;&#8212;&#8211;&gt;&gt;&gt;&gt;<\/p>\n<ul>\n<li>f(n)=2*n^2 + 4*n<\/li>\n<li>f(1)=2*1^2 +4*1 = 2 + 4 = 6<\/li>\n<li>f(2)=2*2^2 +4*2 = 8 + 8 = 16<\/li>\n<li>f(3)=2*3^2 +4*3 = 18 + 12 =30<\/li>\n<li>f(4)=2*4^2 +4*4 = 32 + 16= 48<\/li>\n<\/ul>\n<p>From the above analysis, we can say that n^2 is the leading term in this function and that&#8217;s nature is Quadratic. So we can say that the Order of this function is n^2 because it is a leading term.<\/p>\n<p><img decoding=\"async\" class=\"alignnone  wp-image-7446\" src=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/b3-1-300x231.png\" alt=\"\" width=\"339\" height=\"261\" srcset=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/b3-1-300x231.png 300w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/b3-1.png 472w\" sizes=\"(max-width: 339px) 100vw, 339px\" \/><\/p>\n<p>&#8212;&#8212;&#8212;&#8211;&gt;&gt;&gt;&gt;<\/p>\n<ul>\n<li>f(n) = 2nlogn + 4n +6<\/li>\n<li>f(1) = 2*1*log1 + 4*1 +6 = 2*1*0 + 4 + 6 = 10<\/li>\n<li>f(2) = 2*2*log2 + 4*2 +6 = 2*2*1 + 8 + 6 = 18<\/li>\n<li>f(3) = 2*3*log3 + 4*3 +6 = 2*2*1.584963 + 12+6 = 24.339852<\/li>\n<li>f(4) = 2*4*log4 + 4*4 +6 =2*4*2 + 16 + 6 =38<\/li>\n<\/ul>\n<p>From the above calculations, we can observe here that the leading term in this function is n*log n(base 2) and that&#8217;s nature is Linearithmic. So we can say that the Order of this function is n*log n(base 2) because it is a leading term.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-7447\" src=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/b4-1-300x190.png\" alt=\"\" width=\"358\" height=\"227\" srcset=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/b4-1-300x190.png 300w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/b4-1-768x487.png 768w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/b4-1-624x396.png 624w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/b4-1.png 848w\" sizes=\"(max-width: 358px) 100vw, 358px\" \/><\/p>\n<p><strong>In this way<\/strong>, We can find the time complexities of different-different algorithms.<\/p>\n<p>&#8212;&#8212;&#8212;*************&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<pre class=\"lang:default decode:true\">public static void main(String args[])\r\n\r\n{\r\n\r\n\u00a0\u00a0\u00a0 System.out.println(\"Hello Universe \");\/\/takes a constant time t1 to execute\r\n\r\n}<\/pre>\n<p>f(n) = c1<\/p>\n<p>f(n) = c1*n^0;<\/p>\n<p>So, O(f(n)) = n^0=1<\/p>\n<p>&#8212;&#8212;&#8212;*************&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<pre class=\"lang:default decode:true \">sum = 0;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/takes a constant time t1\r\n\r\nfor(int i=0 ; i&lt;n ; i++)\r\n\r\n{\r\n\r\n\u00a0\u00a0 sum = sum + i;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/take a constant time t2\r\n\r\n}\r\n\r\nf(n) = t1 + t2 * n;\r\n\r\nSo, O(f(n)) = n^1=n<\/pre>\n<p>&nbsp;<\/p>\n<p>&#8212;&#8212;&#8212;*************&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<pre class=\"lang:default decode:true \">public static void main (String args[])\r\n{\r\n\r\n\u00a0\u00a0\u00a0 int m , n;\r\n\r\n\u00a0\u00a0\u00a0 int sum=0;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/takes constant time t1\r\n\r\n\u00a0\u00a0 for(int i=0;i&lt;m;i++)\r\n\r\n\u00a0\u00a0 {\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 for(int j=0;j&lt;n;j++)\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 System.out.println(\"Hello Universe \");\u00a0 \/\/takes constant time t2\u00a0\u00a0\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sum=sum+n;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/takes constant time t3\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }\r\n\r\n\u00a0\u00a0\u00a0 }\r\n\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<p>expression= m*(n*(t3+t2)) + t1<\/p>\n<p>expression= (m*n) * (t2+t3) + t1<\/p>\n<p>When m=n<\/p>\n<p>expression= (n^2) * (t2+t3) + t1<\/p>\n<p>f(n) = (n^2) * (t2+t3) + t1<\/p>\n<p>So, O(f(n)) =n^2<\/p>\n<p>&nbsp;<\/p>\n<p>&#8212;&#8212;&#8212;*************&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<pre class=\"lang:default decode:true\">public static void main(String args[])\r\n\r\n{\r\n\r\n\u00a0\u00a0\u00a0 int sum=0;\u00a0\u00a0 \/\/takes a constant time t1\r\n\r\n\u00a0\u00a0 for(int i=1 ; i&lt;=n ; i * 2)\r\n\r\n\u00a0\u00a0\u00a0\u00a0 {\u00a0\u00a0\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sum = sum +i ;\u00a0 \/\/takes constant time t2\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 }\r\n\r\n}<\/pre>\n<p>consider for loop:\u00a0 2*2*2*&#8230;&#8230;&#8230;&#8230;2(k times) = n<\/p>\n<p>2^k = n<\/p>\n<p>k = log n(base 2)<\/p>\n<p>So, f(n) = k * t2 + t1<\/p>\n<p>f(n) = log n * t2 + t1<\/p>\n<p>Time complexity O(f(n)) = log n(base 2)<\/p>\n<p>&nbsp;<\/p>\n<p>Now We&#8217;ll talk about some sorting algorithms and their Worst Case Time Complexity.<\/p>\n<ul>\n<li>Insertion Sort &#8211; O(n^2),<\/li>\n<li>Selection Sort &#8211; O(n^2),<\/li>\n<li>Bubble Sort &#8211; O(n^2),<\/li>\n<li>Quick Sort &#8211; O(n^2),<\/li>\n<li>Merge Sort &#8211; O(n*log n)<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-7448\" src=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/b5-1-300x243.png\" alt=\"\" width=\"388\" height=\"314\" srcset=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/b5-1-300x243.png 300w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/b5-1-768x622.png 768w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/b5-1-624x505.png 624w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/b5-1.png 915w\" sizes=\"(max-width: 388px) 100vw, 388px\" \/><\/p>\n<p><strong>Comparison of Worst Case Time Complexity of given algorithms<\/strong><\/p>\n<p>By Graph we can analyze the:<\/p>\n<ul>\n<li>When n=2 then\u00a0\u00a0 n^2\u00a0\u00a0 &gt;\u00a0 n*log n<\/li>\n<li>When n=3 then\u00a0\u00a0 n^2\u00a0\u00a0 &gt;\u00a0 n*log n<\/li>\n<li>When n=4 then\u00a0\u00a0 n^2\u00a0\u00a0 &gt;\u00a0 n*log n<\/li>\n<\/ul>\n<p>Here there is a question, Why are we considering Worst Case Time Complexity?, Because in any algorithm we do not make sure which case will happen which is why we are considering Worst Case Time Complexity.<\/p>\n<p>So, By the above Comparision, we can say that <strong>Merge Sort <\/strong>is <strong>better <\/strong>than all the other four Sorting Algorithms in the worst case.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is Time Complexity? Time Complexity is the time consumed by the algorithm to complete its execution. Time Complexity is measured by summing the time of all the elementary operations. There are many notations to represent the time complexity like:- (1)Big Oh, O (2)Omega, \u03a9 (3)Theta, \u0398 But, the most commonly used notation for Time [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":7449,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,256,360],"tags":[785,723,224,810],"class_list":["post-7443","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android","category-java-application","category-javascript","tag-annotation-in-java","tag-blogging","tag-java","tag-java-algorithms"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>BLOG ON TIME COMPLEXITY OF ALGORITHM - InnovationM - Blog<\/title>\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.innovationm.com\/blog\/blog-on-time-complexity-of-algorithm\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"BLOG ON TIME COMPLEXITY OF ALGORITHM - InnovationM - Blog\" \/>\n<meta property=\"og:description\" content=\"What is Time Complexity? Time Complexity is the time consumed by the algorithm to complete its execution. Time Complexity is measured by summing the time of all the elementary operations. There are many notations to represent the time complexity like:- (1)Big Oh, O (2)Omega, \u03a9 (3)Theta, \u0398 But, the most commonly used notation for Time [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.innovationm.com\/blog\/blog-on-time-complexity-of-algorithm\/\" \/>\n<meta property=\"og:site_name\" content=\"InnovationM - Blog\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-13T08:15:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/Time-Complexity-of-Algorithm.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1689\" \/>\n\t<meta property=\"og:image:height\" content=\"950\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"InnovationM Admin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InnovationM Admin\" \/>\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.innovationm.com\\\/blog\\\/blog-on-time-complexity-of-algorithm\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/blog-on-time-complexity-of-algorithm\\\/\"},\"author\":{\"name\":\"InnovationM Admin\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#\\\/schema\\\/person\\\/a831bf4602d69d1fa452e3de0c8862ed\"},\"headline\":\"BLOG ON TIME COMPLEXITY OF ALGORITHM\",\"datePublished\":\"2022-10-13T08:15:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/blog-on-time-complexity-of-algorithm\\\/\"},\"wordCount\":569,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/blog-on-time-complexity-of-algorithm\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/Time-Complexity-of-Algorithm.png\",\"keywords\":[\"annotation in java\",\"blogging\",\"java\",\"java algorithms\"],\"articleSection\":[\"Android\",\"Java Application\",\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/blog-on-time-complexity-of-algorithm\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/blog-on-time-complexity-of-algorithm\\\/\",\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/blog-on-time-complexity-of-algorithm\\\/\",\"name\":\"BLOG ON TIME COMPLEXITY OF ALGORITHM - InnovationM - Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/blog-on-time-complexity-of-algorithm\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/blog-on-time-complexity-of-algorithm\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/Time-Complexity-of-Algorithm.png\",\"datePublished\":\"2022-10-13T08:15:15+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#\\\/schema\\\/person\\\/a831bf4602d69d1fa452e3de0c8862ed\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/blog-on-time-complexity-of-algorithm\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/blog-on-time-complexity-of-algorithm\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/blog-on-time-complexity-of-algorithm\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/Time-Complexity-of-Algorithm.png\",\"contentUrl\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/Time-Complexity-of-Algorithm.png\",\"width\":1689,\"height\":950},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/blog-on-time-complexity-of-algorithm\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"BLOG ON TIME COMPLEXITY OF ALGORITHM\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/\",\"name\":\"InnovationM - Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#\\\/schema\\\/person\\\/a831bf4602d69d1fa452e3de0c8862ed\",\"name\":\"InnovationM Admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g\",\"caption\":\"InnovationM Admin\"},\"sameAs\":[\"http:\\\/\\\/www.innovationm.com\\\/\"],\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/author\\\/innovationmadmin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"BLOG ON TIME COMPLEXITY OF ALGORITHM - InnovationM - Blog","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.innovationm.com\/blog\/blog-on-time-complexity-of-algorithm\/","og_locale":"en_US","og_type":"article","og_title":"BLOG ON TIME COMPLEXITY OF ALGORITHM - InnovationM - Blog","og_description":"What is Time Complexity? Time Complexity is the time consumed by the algorithm to complete its execution. Time Complexity is measured by summing the time of all the elementary operations. There are many notations to represent the time complexity like:- (1)Big Oh, O (2)Omega, \u03a9 (3)Theta, \u0398 But, the most commonly used notation for Time [&hellip;]","og_url":"https:\/\/www.innovationm.com\/blog\/blog-on-time-complexity-of-algorithm\/","og_site_name":"InnovationM - Blog","article_published_time":"2022-10-13T08:15:15+00:00","og_image":[{"width":1689,"height":950,"url":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/Time-Complexity-of-Algorithm.png","type":"image\/png"}],"author":"InnovationM Admin","twitter_misc":{"Written by":"InnovationM Admin","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.innovationm.com\/blog\/blog-on-time-complexity-of-algorithm\/#article","isPartOf":{"@id":"https:\/\/www.innovationm.com\/blog\/blog-on-time-complexity-of-algorithm\/"},"author":{"name":"InnovationM Admin","@id":"https:\/\/www.innovationm.com\/blog\/#\/schema\/person\/a831bf4602d69d1fa452e3de0c8862ed"},"headline":"BLOG ON TIME COMPLEXITY OF ALGORITHM","datePublished":"2022-10-13T08:15:15+00:00","mainEntityOfPage":{"@id":"https:\/\/www.innovationm.com\/blog\/blog-on-time-complexity-of-algorithm\/"},"wordCount":569,"commentCount":0,"image":{"@id":"https:\/\/www.innovationm.com\/blog\/blog-on-time-complexity-of-algorithm\/#primaryimage"},"thumbnailUrl":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/Time-Complexity-of-Algorithm.png","keywords":["annotation in java","blogging","java","java algorithms"],"articleSection":["Android","Java Application","JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.innovationm.com\/blog\/blog-on-time-complexity-of-algorithm\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.innovationm.com\/blog\/blog-on-time-complexity-of-algorithm\/","url":"https:\/\/www.innovationm.com\/blog\/blog-on-time-complexity-of-algorithm\/","name":"BLOG ON TIME COMPLEXITY OF ALGORITHM - InnovationM - Blog","isPartOf":{"@id":"https:\/\/www.innovationm.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.innovationm.com\/blog\/blog-on-time-complexity-of-algorithm\/#primaryimage"},"image":{"@id":"https:\/\/www.innovationm.com\/blog\/blog-on-time-complexity-of-algorithm\/#primaryimage"},"thumbnailUrl":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/Time-Complexity-of-Algorithm.png","datePublished":"2022-10-13T08:15:15+00:00","author":{"@id":"https:\/\/www.innovationm.com\/blog\/#\/schema\/person\/a831bf4602d69d1fa452e3de0c8862ed"},"breadcrumb":{"@id":"https:\/\/www.innovationm.com\/blog\/blog-on-time-complexity-of-algorithm\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.innovationm.com\/blog\/blog-on-time-complexity-of-algorithm\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.innovationm.com\/blog\/blog-on-time-complexity-of-algorithm\/#primaryimage","url":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/Time-Complexity-of-Algorithm.png","contentUrl":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2022\/10\/Time-Complexity-of-Algorithm.png","width":1689,"height":950},{"@type":"BreadcrumbList","@id":"https:\/\/www.innovationm.com\/blog\/blog-on-time-complexity-of-algorithm\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.innovationm.com\/blog\/"},{"@type":"ListItem","position":2,"name":"BLOG ON TIME COMPLEXITY OF ALGORITHM"}]},{"@type":"WebSite","@id":"https:\/\/www.innovationm.com\/blog\/#website","url":"https:\/\/www.innovationm.com\/blog\/","name":"InnovationM - Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.innovationm.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.innovationm.com\/blog\/#\/schema\/person\/a831bf4602d69d1fa452e3de0c8862ed","name":"InnovationM Admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g","caption":"InnovationM Admin"},"sameAs":["http:\/\/www.innovationm.com\/"],"url":"https:\/\/www.innovationm.com\/blog\/author\/innovationmadmin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/posts\/7443","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/comments?post=7443"}],"version-history":[{"count":0,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/posts\/7443\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/media\/7449"}],"wp:attachment":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/media?parent=7443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/categories?post=7443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/tags?post=7443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}