<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>results &#8211; stoimen&#039;s web log</title>
	<atom:link href="/tag/results/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>on web development</description>
	<lastBuildDate>Tue, 13 Feb 2018 08:18:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>You think you know algorithms. Quiz results!</title>
		<link>/2012/02/29/you-think-you-know-algorithms-quiz-results/</link>
		<comments>/2012/02/29/you-think-you-know-algorithms-quiz-results/#respond</comments>
		<pubDate>Wed, 29 Feb 2012 13:27:43 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[quiz]]></category>
		<category><![CDATA[algorithms]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[results]]></category>

		<guid isPermaLink="false">/?p=2790</guid>
		<description><![CDATA[1. Which is the fastest searching algorithm? Jump search Binary search correct answer Interpolation search 2. What is the complexity of binary search? O(log(n*n)) O(log(n)) correct answer O(n*log(n)) 3. Which search algorithm is faster? Binary search correct answer Fibonacci search 4. Which is better for natural language encoding? Run-length encoding Diagram encoding Pattern substitution correct &#8230; <a href="/2012/02/29/you-think-you-know-algorithms-quiz-results/" class="more-link">Continue reading <span class="screen-reader-text">You think you know algorithms. Quiz results!</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2012/05/09/you-think-you-know-algorithms-quiz-results-2/" rel="bookmark" title="You think you know algorithms. Quiz results!">You think you know algorithms. Quiz results! </a></li>
<li><a href="/2012/03/07/you-think-you-know-javascript-quiz-results/" rel="bookmark" title="You think you know javascript. Quiz results!">You think you know javascript. Quiz results! </a></li>
<li><a href="/2012/03/16/you-think-you-know-php-quiz-results/" rel="bookmark" title="You think you know PHP. Quiz Results!">You think you know PHP. Quiz Results! </a></li>
<li><a href="/2012/01/02/computer-algorithms-interpolation-search/" rel="bookmark" title="Computer Algorithms: Interpolation Search">Computer Algorithms: Interpolation Search </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p><strong>1. Which is the fastest searching algorithm?</strong></p>
<ul>
<li>Jump search</li>
<li>Binary search <span style="color: #339966;">correct answer</span></li>
<li>Interpolation search</li>
</ul>
<p><figure id="attachment_2824" style="width: 600px" class="wp-caption alignnone"><a href="/wp-content/uploads/2012/02/answer2.png"><img class="size-full wp-image-2824" title="Which is the fastest searching algorithm?" src="/wp-content/uploads/2012/02/answer2.png" alt="Which is the fastest searching algorithm?" width="600" height="371" srcset="/wp-content/uploads/2012/02/answer2.png 600w, /wp-content/uploads/2012/02/answer2-300x185.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a><figcaption class="wp-caption-text"> </figcaption></figure><br />
<span id="more-2790"></span><br />
<strong>2. What is the complexity of binary search?</strong></p>
<ul>
<li>O(log(n*n))</li>
<li>O(log(n)) <span style="color: #339966;">correct answer</span></li>
<li>O(n*log(n))</li>
</ul>
<figure id="attachment_2822" style="width: 600px" class="wp-caption alignnone"><a href="/wp-content/uploads/2012/02/answer1.png"><img src="/wp-content/uploads/2012/02/answer1.png" alt="What is the complexity of binary search?" title="AWhat is the complexity of binary search?" width="600" height="371" class="size-full wp-image-2822" srcset="/wp-content/uploads/2012/02/answer1.png 600w, /wp-content/uploads/2012/02/answer1-300x185.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a><figcaption class="wp-caption-text"> </figcaption></figure>
<p><strong>3. Which search algorithm is faster?</strong></p>
<ul>
<li>Binary search <span style="color: #339966;">correct answer</span></li>
<li>Fibonacci search</li>
</ul>
<figure id="attachment_2833" style="width: 600px" class="wp-caption alignnone"><a href="/wp-content/uploads/2012/02/answer3.png"><img src="/wp-content/uploads/2012/02/answer3.png" alt="Which search algorithm is faster?" title="Which search algorithm is faster?" width="600" height="371" class="size-full wp-image-2833" srcset="/wp-content/uploads/2012/02/answer3.png 600w, /wp-content/uploads/2012/02/answer3-300x185.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a><figcaption class="wp-caption-text"> </figcaption></figure>
<p><strong>4. Which is better for natural language encoding?</strong></p>
<ul>
<li>Run-length encoding</li>
<li>Diagram encoding</li>
<li>Pattern substitution <span style="color: #339966;">correct answer</span></li>
</ul>
<figure id="attachment_2834" style="width: 600px" class="wp-caption alignnone"><a href="/wp-content/uploads/2012/02/answer4.png"><img src="/wp-content/uploads/2012/02/answer4.png" alt="Which is better for natural language encoding?" title="Which is better for natural language encoding?" width="600" height="371" class="size-full wp-image-2834" srcset="/wp-content/uploads/2012/02/answer4.png 600w, /wp-content/uploads/2012/02/answer4-300x185.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a><figcaption class="wp-caption-text"> </figcaption></figure>
<p><strong>5. What is the complexity of searching into a hash table?</strong></p>
<ul>
<li>Quadratic</li>
<li>Logaritmic</li>
<li>Linear</li>
</ul>
<p><em>Note! &#8211; here (my fault) there&#8217;s no correct answer. The correct answer is that searching into a hash table has constant complexity &#8211; O(1). However I&#8217;ll assume that all of you that answered with &#8220;Linear&#8221; are right!</em></p>
<figure id="attachment_2835" style="width: 600px" class="wp-caption alignnone"><a href="/wp-content/uploads/2012/02/answer5.png"><img src="/wp-content/uploads/2012/02/answer5.png" alt="What is the complexity of searching into a hash table?" title="What is the complexity of searching into a hash table?" width="600" height="371" class="size-full wp-image-2835" srcset="/wp-content/uploads/2012/02/answer5.png 600w, /wp-content/uploads/2012/02/answer5-300x185.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a><figcaption class="wp-caption-text"> </figcaption></figure>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2012/05/09/you-think-you-know-algorithms-quiz-results-2/" rel="bookmark" title="You think you know algorithms. Quiz results!">You think you know algorithms. Quiz results! </a></li>
<li><a href="/2012/03/07/you-think-you-know-javascript-quiz-results/" rel="bookmark" title="You think you know javascript. Quiz results!">You think you know javascript. Quiz results! </a></li>
<li><a href="/2012/03/16/you-think-you-know-php-quiz-results/" rel="bookmark" title="You think you know PHP. Quiz Results!">You think you know PHP. Quiz Results! </a></li>
<li><a href="/2012/01/02/computer-algorithms-interpolation-search/" rel="bookmark" title="Computer Algorithms: Interpolation Search">Computer Algorithms: Interpolation Search </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2012/02/29/you-think-you-know-algorithms-quiz-results/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speed Up the jQuery Code: Selectors&#8217; Cache</title>
		<link>/2010/06/19/speed-up-the-jquery-code-selectors-cache/</link>
		<comments>/2010/06/19/speed-up-the-jquery-code-selectors-cache/#comments</comments>
		<pubDate>Sat, 19 Jun 2010 08:36:08 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[chart]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[measurement]]></category>
		<category><![CDATA[results]]></category>
		<category><![CDATA[selectors]]></category>
		<category><![CDATA[tables]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">/?p=1630</guid>
		<description><![CDATA[Short Experiment Here&#8217;s a short optimization of a small chunk of jQuery code. The experiment was to increment the number of DOM element access. In this case this was a change of the innerHTML property &#8211; using the $.html() method. I&#8217;ve measured the result with the console.time() method and thus I expect correct results for &#8230; <a href="/2010/06/19/speed-up-the-jquery-code-selectors-cache/" class="more-link">Continue reading <span class="screen-reader-text">Speed Up the jQuery Code: Selectors&#8217; Cache</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2009/11/04/jquery-css-selectors-change-one-or-more-css-properties/" rel="bookmark" title="jQuery CSS selectors. Change one or more CSS properties!">jQuery CSS selectors. Change one or more CSS properties! </a></li>
<li><a href="/2010/02/09/optimizing-openlayers-speed-up-markers-load-time/" rel="bookmark" title="Optimizing OpenLayers. Speed up markers load time!">Optimizing OpenLayers. Speed up markers load time! </a></li>
<li><a href="/2010/02/02/firebugs-console-time-accuracy/" rel="bookmark" title="Firebug&#8217;s console.time() accuracy">Firebug&#8217;s console.time() accuracy </a></li>
<li><a href="/2010/06/24/zend-framework-inject-javascript-code-in-a-actionview/" rel="bookmark" title="Zend Framework: Inject JavaScript Code in a Action/View">Zend Framework: Inject JavaScript Code in a Action/View </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>Short Experiment</h2>
<p>Here&#8217;s a short optimization of a small chunk of jQuery code. The experiment was to increment the number of DOM element access. In this case this was a change of the innerHTML property &#8211; using the $.html() method.</p>
<p>I&#8217;ve measured the result with the console.time() method and thus I expect correct results for both cases. In the first case I directly call the jQuery selectors&#8217; html() method:</p>
<pre lang="javascript">
for (var i = 0; i < 10000; i++) {
    $('#container').html(i);
}
</pre>
<p>While in the second case I "cache" it before the loop:</p>
<pre lang="javascript">
var t = $('#container');
for (var i = 0; i < 10000; i++) {
    t.html(i);
}
</pre>
<p>and here's the full code in the first case:</p>
<pre lang="html4strict">
<html>
<head>
    <title>jQuery Cache</title>
</head>
<body>

<div id="container"></div>

<script src="/scripts/library.js"></script>
<script>

$(document).ready(function() {

    console.time('foo');
    for (var i = 0; i < 10000; i++) {
        $('#container').html(i);
    }
    console.timeEnd('foo');
});
</script>
</body>
</html>
</pre>
<h2>The Results</h2>
<p>As expected the second "cached" approach gave better results. With the increment of the iterations the second method began to be slightly better than the first one. That's not so much, but imagine you have more than one selector in the loop's body?</p>
<h3>Numbers:</h3>
<p><img src="/wp-content/uploads/2010/06/table.png" /><br />
Note that in the time is in ms, and, yes, this is not so much, but when you deal with large data and you've more than one selector in the loop's body, this can be critical!</p>
<h3>Graphics:</h3>
<p><img src="/wp-content/uploads/2010/06/chart.png" /></p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2009/11/04/jquery-css-selectors-change-one-or-more-css-properties/" rel="bookmark" title="jQuery CSS selectors. Change one or more CSS properties!">jQuery CSS selectors. Change one or more CSS properties! </a></li>
<li><a href="/2010/02/09/optimizing-openlayers-speed-up-markers-load-time/" rel="bookmark" title="Optimizing OpenLayers. Speed up markers load time!">Optimizing OpenLayers. Speed up markers load time! </a></li>
<li><a href="/2010/02/02/firebugs-console-time-accuracy/" rel="bookmark" title="Firebug&#8217;s console.time() accuracy">Firebug&#8217;s console.time() accuracy </a></li>
<li><a href="/2010/06/24/zend-framework-inject-javascript-code-in-a-actionview/" rel="bookmark" title="Zend Framework: Inject JavaScript Code in a Action/View">Zend Framework: Inject JavaScript Code in a Action/View </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/06/19/speed-up-the-jquery-code-selectors-cache/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
