<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Algorithms Q&amp;A - Recent questions in Randomized Algorithms</title>
<link>https://notexponential.com/questions/randomized-algorithms</link>
<description>Powered by Question2Answer</description>
<item>
<title>Randomized Algorithm - Basics (4 Questions in 1)</title>
<link>https://notexponential.com/594/randomized-algorithm-basics-4-questions-in-1</link>
<description>&lt;p&gt;&lt;span style=&quot;color:#222222&quot;&gt;What is the time complexity of this algorithm&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;span style=&quot;color:#222222&quot;&gt;for i = 1 to n {&lt;/span&gt;&lt;span style=&quot;color:#313131&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color:#222222&quot;&gt;    if random() &amp;gt; 0.5 {&lt;/span&gt;&lt;span style=&quot;color:#313131&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color:#222222&quot;&gt;        exit()    // This is question option a.
                  // There are 3 other questions, where this statement is replaced by
                  &lt;/span&gt;&lt;span style=&quot;color:#313131&quot;&gt;// b.  i = i + 1
                  &lt;/span&gt;// c.  i = i - 1
                  // d.  i = 2 * i
&lt;span style=&quot;color:#222222&quot;&gt;    }
&lt;/span&gt;&lt;span style=&quot;color:#313131&quot;&gt;}
&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;Assume that random() returns a number uniformly in the 0 to 1 range.&lt;/p&gt;</description>
<category>Randomized Algorithms</category>
<guid isPermaLink="true">https://notexponential.com/594/randomized-algorithm-basics-4-questions-in-1</guid>
<pubDate>Wed, 12 Sep 2018 19:27:15 +0000</pubDate>
</item>
</channel>
</rss>