{"id":83,"date":"2020-04-01T13:31:56","date_gmt":"2020-04-01T13:31:56","guid":{"rendered":"https:\/\/temp.ashkerala.com\/?p=83"},"modified":"2020-04-01T13:31:56","modified_gmt":"2020-04-01T13:31:56","slug":"measuring-performance-of-algorithms","status":"publish","type":"post","link":"https:\/\/temp.ashkerala.com\/?p=83","title":{"rendered":"Measuring Performance of Algorithms"},"content":{"rendered":"<p><strong>There are <em>two aspects <\/em>of algorithmic performance:<\/strong><\/p>\n<p><strong>Time<\/strong><\/p>\n<p style=\"margin-left: 0.25in;\">&#8211; Instructions take time.<\/p>\n<p style=\"margin-left: 0.25in;\">&#8211; How fast does the algorithm perform?<\/p>\n<p style=\"margin-left: 0.25in;\">&#8211; What affects its runtime?<\/p>\n<p><strong>Space<\/strong><\/p>\n<p style=\"margin-left: 0.25in;\">&#8211; Data structures take\u00a0\u00a0\u00a0 space<\/p>\n<p style=\"margin-left: 0.25in;\">&#8211; What kind of data structures can be used?<\/p>\n<p style=\"margin-left: 0.5in;\">&#8211;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 How does choice of data structure affect the runtime?<\/p>\n<p style=\"margin-left: 0.25in;\">Algorithms can not be compared by running them on computers. Run time is system dependent.<\/p>\n<p style=\"margin-left: 0.25in;\">Even on same computer would depend on language<\/p>\n<p style=\"margin-left: 0.25in;\">Real time units like microseconds not to be used.<\/p>\n<p style=\"margin-left: 0.25in;\">Generally concerned with how the amount of work varies with the data.<\/p>\n<p><strong>Measuring\u00a0 Time Complexity<\/strong><\/p>\n<p>Counting\u00a0 number of operations\u00a0 involved in the algorithms to handle\u00a0 n items.<\/p>\n<p>Meaningful comparison for very large values of\u00a0\u00a0 n.<\/p>\n<p><strong>Complexity of Linear Search<\/strong><\/p>\n<p>Consider the task of searching a list to see if it contains a particular value.<\/p>\n<p>\u0393\u00c7\u00f3 A useful search algorithm should be <em>general.<\/em><\/p>\n<p>\u0393\u00c7\u00f3 Work done varies with the size of the list<\/p>\n<p>\u0393\u00c7\u00f3 What can we say about the work done for list of <em>any <\/em>length?<\/p>\n<p>i = 0;<\/p>\n<p>while (i &lt; MAX &amp;&amp; this_array[i] != target)<\/p>\n<p>\u00a0\u00a0\u00a0 \u00a0i = i + 1;<\/p>\n<p>if (i &lt;MAX)\u00a0<\/p>\n<p>\u00a0\u00a0\u00a0 printf ( \u0393\u00c7\u00a3Yes, target is there \\n\u0393\u00c7\u00a5 );<\/p>\n<p>else<\/p>\n<p>\u00a0\u00a0\u00a0 printf( \u0393\u00c7\u00a3No, target isn\u0393\u00c7\u00d6t there \\n\u0393\u00c7\u00a5 );<\/p>\n<p>\u00a0The work involved :\u00a0 Checking target value with each of the n elements.<\/p>\n<p>\u00a0no. of operations:\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1 \u00a0\u00a0\u00a0\u00a0 \u00a0(best case)<\/p>\n<p>\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 n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (worst case)<\/p>\n<p>\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 n\/2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (average case)<\/p>\n<p>Computer scientists tend to\u00a0 be concerned about the<\/p>\n<p><strong>\u00a0<em>Worst Case complexity<\/em>.<\/strong><\/p>\n<p>\u00a0The worst case guarantees that the performance of the algorithm will be at least as good as the analysis indicates.<\/p>\n<p><strong><em>Average Case Complexity:<\/em><\/strong><\/p>\n<p>It is the best statistical estimate of actual performance, and tells us how well an algorithm performs if you average the behavior over all possible sets of input data. However, it requires considerable mathematical sophistication\u00a0 to do the average case analysis.<\/p>\n<p><strong>Algorithm Analysis: Loops<\/strong><\/p>\n<p>Consider\u00a0\u00a0 an\u00a0 n X n\u00a0 two dimensional array. Write a loop to store the row sums in a one-dimensional array rowsand the overall total in grandTotal.<\/p>\n<div>\n<p><strong>LOOP 1:<\/strong><\/p>\n<\/div>\n<p>grandTotal = 0;<\/p>\n<p>for (k=0; k&lt;n-1; ++k)\u00a0 {<\/p>\n<p>rows[k] = 0;<\/p>\n<p>for (j = 0; j &lt;n-1; ++j){<\/p>\n<p style=\"margin-left: 0.5in;\">rows[k] = rows[k] + matrix[k][j];<\/p>\n<p style=\"margin-left: 0.5in;\">grandTotal = grandTotal + matrix[k][j];<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>\u00a0It takes 2n<sup>2\u00a0 <\/sup>addition operations<\/p>\n<div>\n<p><strong>LOOP 2:<\/strong><\/p>\n<\/div>\n<p>grandTotal =0;<\/p>\n<p>for (k=0; k&lt;n-1; ++k)<\/p>\n<p>rows[k] = 0;<\/p>\n<p>for (j = 0; j &lt;n-1; ++j)<\/p>\n<p style=\"margin-left: 0.5in;\">rows[k] = rows[k] + matrix[k][j];<\/p>\n<p>grandTotal = grandTotal + rows[k];<\/p>\n<p>}<\/p>\n<p>This one takesn<sup>2<\/sup>+ n\u00a0 operations<\/p>\n<p><strong>Big-O Notation<\/strong><\/p>\n<p>We want to understand how the performance of an algorithm responds to changes in problem size. Basically the goal is to provide a <em>qualitative<\/em> insight. The Big-O notation is a way of measuring the order of magnitude of a mathematical expression<\/p>\n<p>\u00a0O(n)\u00a0 means on the Order of n<\/p>\n<p><em><strong>Consider<\/strong><\/em><\/p>\n<p><em>n<sup>4<\/sup> + 3<sub>1<\/sub>n<sup>2<\/sup> + 10\u00a0\u00a0 = f (n)<\/em><\/p>\n<p>The idea is to reduce the formula in the parentheses so that it captures the qualitative behavior in simplest possible terms. We eliminate any term whose contribution to the total ceases to be significant as\u00a0\u00a0 n\u00a0 becomes large.<\/p>\n<p>We also eliminate any constant factors, as these have no effect on the overall pattern\u00a0\u00a0 as\u00a0 n\u00a0 increases.\u00a0 Thus we may approximate f(n) above as<\/p>\n<p><em>O (n<sup>4<\/sup> + 3<sub>1<\/sub>n<sup>2<\/sup> + 10) = O(\u00a0 n<sup>4)<\/sup><\/em><\/p>\n<p>\u00a0Let g(n)\u00a0 =\u00a0 <em>n<sup>4<\/sup><\/em><\/p>\n<p>Then the order of f(n) is O[g(n)].\u00a0<\/p>\n<p><strong>Definition:<\/strong>f(n)\u00a0 is O(g(n)) if there exist positive numbers c and N such that\u00a0 f(n) &lt; = c g(n) for all\u00a0 n &gt;=N.<\/p>\n<p>\u00a0i.e.\u00a0 f\u00a0 is big \u0393\u00c7\u00f4O of\u00a0 g\u00a0\u00a0 if there is\u00a0\u00a0 c such that\u00a0\u00a0 f\u00a0 is not larger than\u00a0 cg\u00a0 for sufficiently large\u00a0\u00a0 value of n ( greater than N)<\/p>\n<p>c g(n) is an upper bound on the value of\u00a0 f(n)<\/p>\n<p>That is, the number of operations is at worst proportional to g<em>(n)<\/em> for all large values of <em>n<\/em>.<\/p>\n<p>How does one determine\u00a0 c and N?<\/p>\n<p>Let f(n) = 2 <em>n<sup>2<\/sup> + 3n + 1\u00a0\u00a0 = O (n<sup>2<\/sup><\/em> )<\/p>\n<p>Now\u00a0 2 <em>n<sup>2<\/sup> + 3n + 1\u00a0 &lt; = c n<sup>2<\/sup><\/em><\/p>\n<p>Or\u00a0 2 +\u00a0 (3\/n) + ( 1 \/ <em>n<sup>2<\/sup><\/em>\u00a0\u00a0 )\u00a0 &lt; = c<\/p>\n<p>You\u00a0 want to find c such that a term in\u00a0 f\u00a0 becomes the largest and stays the largest.\u00a0 Compare first and second term. First will overtake the second at\u00a0 N = 2,<\/p>\n<p>so for N= 2, c &gt;= 3.75,<\/p>\n<p>for N = 5,\u00a0\u00a0 c &gt;= slightly more than 2,\u00a0<\/p>\n<p>for very large value of n, c is almost 2.<\/p>\n<p>g is\u00a0 almost always &gt; = f\u00a0 if it is multiplied by a constant c<\/p>\n<p>Look at it another way : suppose you\u00a0 want to find weight of\u00a0 elephants, cats and ants in a jungle. Now irrespective of how many of each item were there, the net weight would be proportional to the weight of an elephant.<\/p>\n<p>Incidentally we can also say\u00a0 f\u00a0 is big -O not only of\u00a0\u00a0\u00a0 <em>n<sup>2<\/sup><\/em> but also of <em>n<sup>3<\/sup><\/em>\u00a0\u00a0 , <em>n<sup>4<\/sup><\/em>\u00a0\u00a0\u00a0 , <em>n<sup>5<\/sup><\/em>\u00a0\u00a0 etc\u00a0 (HOW ?)<\/p>\n<p style=\"margin-left: 0.25in;\">\u252c\u00a1\u00a0 Loop 1 and Loop 2 are both in the same big-O category: O(n<sup>2<\/sup>)<\/p>\n<p><strong>\u00a0Properties of Big-O notation:<\/strong><\/p>\n<p>O(n)\u00a0 + O(m)\u00a0 = O(n) if\u00a0 n &gt; = m<\/p>\n<p>The function log n to base a is\u00a0 order of O( log n to base b)<\/p>\n<p>For any values of a and b\u00a0 ( you can show that any\u00a0 log values are multiples of each other)<\/p>\n<p><strong>Linear search Algorithm:<\/strong><\/p>\n<p><strong>Best Case<\/strong>&#8211; It\u0393\u00c7\u00d6s the first value<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u0393\u00c7\u00a3order 1,\u0393\u00c7\u00a5 O(1)<\/p>\n<p><strong>Worst Case<\/strong>&#8211; It\u0393\u00c7\u00d6s the last value, n<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u0393\u00c7\u00a3order n,\u0393\u00c7\u00a5 O(n)<\/p>\n<p><strong>Average<\/strong>&#8211; N\/2 (if value is present)<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u0393\u00c7\u00a3order n,\u0393\u00c7\u00a5 O(n)<\/p>\n<p><strong>Example 1:<\/strong><\/p>\n<p>Use big-O notation to analyze the time efficiency of the following fragment of C code:<\/p>\n<p><strong>for(k = 1; k &lt;= n\/2; k++) <\/strong><\/p>\n<p><strong>{<\/strong><\/p>\n<p><strong>\u00a0\u00a0\u00a0 .<\/strong><\/p>\n<p><strong>\u00a0\u00a0\u00a0 .<\/strong><\/p>\n<p><strong>\u00a0\u00a0\u00a0 for (j = 1; j &lt;= n*n; j++)<\/strong><\/p>\n<p><strong>\u00a0\u00a0\u00a0 {<\/strong><\/p>\n<p><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 .<\/strong><\/p>\n<p><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 .<\/strong><\/p>\n<p><strong>\u00a0\u00a0\u00a0 }<\/strong><\/p>\n<p><strong>}<\/strong><\/p>\n<p>Since these loops are nested, the efficiency is <em>n<sup>3<\/sup>\/2<\/em>, or O(<em>n<sup>3<\/sup><\/em>) in big-O terms.<\/p>\n<p>Thus, for two loops with O[<em>f<sub>1<\/sub>(n)<\/em>] and O[<em>f<sub>2<\/sub>(n)<\/em>] efficiencies, the efficiency of the nesting of these two loops is<\/p>\n<p>O[<em>f<sub>1<\/sub>(n) * f<sub>2<\/sub>(n)<\/em>].<\/p>\n<p><strong>Example 2:<\/strong><\/p>\n<p>Use big-O notation to analyze the time efficiency of the following fragment of C code:<\/p>\n<p><strong>for (k=1; k&lt;=n\/2; k++)<\/strong><\/p>\n<p><strong>{<\/strong><\/p>\n<p><strong>\u00a0\u00a0\u00a0 .<\/strong><\/p>\n<p><strong>\u00a0\u00a0\u00a0 .<\/strong><\/p>\n<p><strong>}<\/strong><\/p>\n<p><strong>for (j = 1; j &lt;= n*n; j++)<\/strong><\/p>\n<p><strong>{<\/strong><\/p>\n<p><strong>\u00a0\u00a0\u00a0 .<\/strong><\/p>\n<p><strong>\u00a0\u00a0\u00a0 .<\/strong><\/p>\n<p><strong>}<\/strong><\/p>\n<p>The number of operations executed by these loops is the sum of the individual loop efficiencies. Hence, the efficiency is <em>n\/2+n<sup>2<\/sup><\/em>, or O(<em>n<sup>2<\/sup><\/em>) in big-O terms.<\/p>\n<p>Thus, for two loops with O[<em>f<sub>1<\/sub>(n)<\/em>] and O[<em>f<sub>2<\/sub>(n)<\/em>] efficiencies, the efficiency of the sequencing of these two loops is<\/p>\n<p>O[<em>f<sub>D<\/sub>(n)<\/em>] where <em>f<sub>D<\/sub>(n) <\/em>is the dominant of the functions <em>f<sub>1<\/sub>(n) <\/em>and <em>f<sub>2<\/sub>(n)<\/em>.<\/p>\n<p><strong>Complexity of Linear Search<\/strong><\/p>\n<p>In measuring performance, we are generally concerned with how the amount of work varies with the data. Consider, for example, the task of searching a list to see if it contains a particular value.<\/p>\n<p>\u0393\u00c7\u00f3 A useful search algorithm should be <em>general.<\/em><\/p>\n<p>\u0393\u00c7\u00f3 Work done varies with the size of the list<\/p>\n<p>\u0393\u00c7\u00f3 What can we say about the work done for list of <em>any <\/em>length?<\/p>\n<p>i = 0;<\/p>\n<p>while (i &lt; MAX &amp;&amp; this_array[i] != target)<\/p>\n<p>\u00a0\u00a0\u00a0 \u00a0i = i + 1;<\/p>\n<p>if (i &lt;MAX)\u00a0<\/p>\n<p>\u00a0\u00a0\u00a0 printf ( \u0393\u00c7\u00a3Yes, target is there \\n\u0393\u00c7\u00a5 );<\/p>\n<p>else<\/p>\n<p>\u00a0\u00a0\u00a0 printf( \u0393\u00c7\u00a3No, target isn\u0393\u00c7\u00d6t there \\n\u0393\u00c7\u00a5 );<\/p>\n<p>\u00a0<\/p>\n<p><strong>Order Notation<\/strong><\/p>\n<p>How much work to find the target in a list containing N elements?<\/p>\n<p><em>Note<\/em>: we care here only about the <em>growth rate <\/em>of work. Thus, we <em>toss out all constant values<\/em>.<\/p>\n<p style=\"margin-left: 0.25in;\">\u252c\u2556\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Best Case work is <em>constant<\/em>; it does not grow with the size of the list.<\/p>\n<p style=\"margin-left: 0.25in;\">\u252c\u2556\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Worst and Average Cases work is <em>proportional <\/em>to the size of the list, N.<\/p>\n<p>\u00a0<\/p>\n<p><strong>\u00a0Order Notation<\/strong><\/p>\n<p><strong><em>O(1) or \u0393\u00c7\u00a3Order One\u0393\u00c7\u00a5: Constant time<\/em><\/strong><\/p>\n<p style=\"margin-left: 0.5in;\">\u252c\u2556\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 does <em>not <\/em>mean that it takes only one operation<\/p>\n<p style=\"margin-left: 0.5in;\">\u252c\u2556\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <em>does <\/em>mean that the work <em>doesn\u0393\u00c7\u00d6t change <\/em>as N changes<\/p>\n<p style=\"margin-left: 0.5in;\">\u252c\u2556\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 is a notation for <em>\u0393\u00c7\u00a3constant work\u0393\u00c7\u00a5<\/em><\/p>\n<p><strong><em>O(n) or \u0393\u00c7\u00a3Order n\u0393\u00c7\u00a5: Linear time<\/em><\/strong><\/p>\n<p style=\"margin-left: 0.5in;\">\u252c\u2556\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 does <em>not <\/em>mean that it takes N operations<\/p>\n<p style=\"margin-left: 0.5in;\">\u252c\u2556\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <em>does <\/em>mean that the work changes in a way that is\u00a0 <em>proportional <\/em>to N<\/p>\n<p style=\"margin-left: 0.5in;\">\u252c\u2556\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 is a notation for <em>\u0393\u00c7\u00a3work grows at a linear rate<\/em>\u0393\u00c7\u00a5<\/p>\n<p><strong>\u00a0O(<em>n<sup>2<\/sup><\/em>)\u00a0 or <em>\u00a0\u0393\u00c7\u00a3Order n<sup>2<\/sup> \u0393\u00c7\u00a5: Quadratic time<\/em><\/strong><\/p>\n<p><strong>O(<em>n<sup>3<\/sup><\/em>)\u00a0 or <em>\u00a0\u0393\u00c7\u00a3Order n<sup>3<\/sup> \u0393\u00c7\u00a5: Cubic time<\/em><\/strong><\/p>\n<p>Algorithms whose efficiency can be expressed in terms of a polynomial of the form<\/p>\n<p><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 a<sub>m<\/sub>n<sup>m<\/sup> + a<sub>m-1<\/sub>n<sup>m-1<\/sup> + &#8230; + a<sub>2<\/sub>n<sup>2<\/sup> + a<sub>1<\/sub>n + a<sub>0<\/sub><\/em><\/p>\n<p>are called <strong><em>polynomial algorithms<\/em><\/strong>.\u00a0 <strong>Order\u00a0 O(<em>n<sup>m<\/sup><\/em>).<\/strong><\/p>\n<p>Some algorithms even take less time than the number of elements in the problem. There is a notion of\u00a0 logarithmic time algorithms.\u00a0<\/p>\n<p>We know\u00a0 <em>10<sup>3<\/sup>\u00a0 =1000 <\/em><\/p>\n<p><em>So we can write it as log<sub>10<\/sub>1000\u00a0 = 3<\/em><\/p>\n<p>Similarly suppose we have<\/p>\n<p><em>2<sup>6<\/sup>\u00a0 =64<\/em><\/p>\n<p>then we can write<\/p>\n<p><em>log<sub>2<\/sub>64\u00a0 = 6<\/em><\/p>\n<p>If\u00a0 the work of an algorithm can be reduced by half in one step, and in k steps we are able to solve the problem then<\/p>\n<p><em>2<sup>k<\/sup>\u00a0 =\u00a0 n<\/em><\/p>\n<p>or in other words<\/p>\n<p><em>log<sub>2<\/sub>n\u00a0 = k<\/em><\/p>\n<p>This algorithm will be having <strong>a logarithmic time<\/strong> complexity ,usually written as\u00a0 <strong>O(ln n).<\/strong><\/p>\n<p>Because <em>log<sub>a<\/sub>n<\/em> will increase much more slowly than <em>n<\/em> itself, logarithmic algorithms are generally very efficient. It also can be shown that it\u00a0 does not matter as to what base value is chosen.<\/p>\n<p><strong>Example 3:<\/strong><\/p>\n<p>Use big-O notation to analyze the time efficiency of the following fragment of C code:<\/p>\n<p><strong>k = n;<\/strong><\/p>\n<p><strong>while (k &gt; 1)<\/strong><\/p>\n<p><strong>{<\/strong><\/p>\n<p style=\"margin-left: 0.5in;\"><strong>.<\/strong><\/p>\n<p style=\"margin-left: 0.5in;\"><strong>.<\/strong><\/p>\n<p style=\"margin-left: 0.5in;\"><strong>k = k\/2;<\/strong><\/p>\n<p><strong>}<\/strong><\/p>\n<p>Since the loop variable is cut in half each time through the loop, the number of times the statements inside the loop will be executed is log<sub>2<\/sub>n.<\/p>\n<p>Thus, an algorithm that halves the data remaining to be processed on each iteration of a loop will be an O(<em>log<sub>2<\/sub>n<\/em>) algorithm.<\/p>\n<p>There are a large number of algorithms whose complexity is <strong>O( n <em>log<sub>2<\/sub>n<\/em>) . <\/strong><\/p>\n<p>Finally there are algorithms whose efficiency is dominated by a term of the form <strong><em>a<sup>n<\/sup><\/em><\/strong><\/p>\n<p>These are called <strong><em>exponential algorithms<\/em><\/strong>. They are of more theoretical rather than practical interest because they cannot reasonably run on typical computers for moderate values of <em>n<\/em>.\u00a0\u00a0<\/p>\n<p>\u00a0<\/p>\n<p><strong>Comparison of <em>N<\/em>, <em>logN <\/em>and <em>N<sup>2<\/sup><\/em><\/strong><\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td style=\"width: 197px;\">\n<p align=\"center\"><strong>N<\/strong><\/p>\n<\/td>\n<td style=\"width: 197px;\">\n<p align=\"center\"><strong>O(LogN)<\/strong><\/p>\n<\/td>\n<td style=\"width: 197px;\">\n<p align=\"center\"><strong>O(N<sup>2<\/sup>)<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 197px;\">\n<p align=\"right\">16<\/p>\n<\/td>\n<td style=\"width: 197px;\">\n<p align=\"center\">4<\/p>\n<\/td>\n<td style=\"width: 197px;\">\n<p>256<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 197px;\">\n<p align=\"right\">64<\/p>\n<\/td>\n<td style=\"width: 197px;\">\n<p align=\"center\">6<\/p>\n<\/td>\n<td style=\"width: 197px;\">\n<p>4K<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 197px;\">\n<p align=\"right\">256<\/p>\n<\/td>\n<td style=\"width: 197px;\">\n<p align=\"center\">8<\/p>\n<\/td>\n<td style=\"width: 197px;\">\n<p>64K<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 197px;\">\n<p align=\"right\">1,024<\/p>\n<\/td>\n<td style=\"width: 197px;\">\n<p align=\"center\">10<\/p>\n<\/td>\n<td style=\"width: 197px;\">\n<p>1M<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 197px;\">\n<p align=\"right\">16,384<\/p>\n<\/td>\n<td style=\"width: 197px;\">\n<p align=\"center\">14<\/p>\n<\/td>\n<td style=\"width: 197px;\">\n<p>256M<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 197px;\">\n<p align=\"right\">131,072<\/p>\n<\/td>\n<td style=\"width: 197px;\">\n<p align=\"center\">17<\/p>\n<\/td>\n<td style=\"width: 197px;\">\n<p>16G<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 197px;\">\n<p align=\"right\">262,144<\/p>\n<\/td>\n<td style=\"width: 197px;\">\n<p align=\"center\">18<\/p>\n<\/td>\n<td style=\"width: 197px;\">\n<p>6.87E+10<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 197px;\">\n<p align=\"right\">524,288<\/p>\n<\/td>\n<td style=\"width: 197px;\">\n<p align=\"center\">19<\/p>\n<\/td>\n<td style=\"width: 197px;\">\n<p>2.74E+11<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 197px;\">\n<p align=\"right\">1,048,576<\/p>\n<\/td>\n<td style=\"width: 197px;\">\n<p align=\"center\">20<\/p>\n<\/td>\n<td style=\"width: 197px;\">\n<p>1.09E+12<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 197px;\">\n<p align=\"right\">1,073,741,824<\/p>\n<\/td>\n<td style=\"width: 197px;\">\n<p align=\"center\">30<\/p>\n<\/td>\n<td style=\"width: 197px;\">\n<p>\u00a01.15E+18<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are two aspects of algorithmic performance: Time &#8211; Instructions take time. &#8211; How fast does the algorithm perform? &#8211; What affects its runtime? Space &#8211; Data structures take\u00a0\u00a0\u00a0 space &#8211; What kind of data structures can be used? &#8211;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 How does choice of data structure affect the runtime? Algorithms can not be compared by&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[8],"tags":[],"class_list":["post-83","post","type-post","status-publish","format-standard","hentry","category-ugc-research"],"_links":{"self":[{"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=\/wp\/v2\/posts\/83","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=83"}],"version-history":[{"count":0,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=\/wp\/v2\/posts\/83\/revisions"}],"wp:attachment":[{"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=83"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=83"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=83"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}