<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wcipeg.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Naive_algorithm</id>
		<title>Naive algorithm - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wcipeg.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Naive_algorithm"/>
		<link rel="alternate" type="text/html" href="http://wcipeg.com/wiki/index.php?title=Naive_algorithm&amp;action=history"/>
		<updated>2026-04-24T09:13:22Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.25.2</generator>

	<entry>
		<id>http://wcipeg.com/wiki/index.php?title=Naive_algorithm&amp;diff=1382&amp;oldid=prev</id>
		<title>Brian at 15:24, 29 June 2011</title>
		<link rel="alternate" type="text/html" href="http://wcipeg.com/wiki/index.php?title=Naive_algorithm&amp;diff=1382&amp;oldid=prev"/>
				<updated>2011-06-29T15:24:45Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 15:24, 29 June 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;An algorithm is said to be '''naive''' when it is simple and straightforward but does not exhibit a desirable level of [[Analysis of algorithms|efficiency]] (usually in terms of time, but also possibly memory) despite finding a correct solution or it does not find an optimal solution to an [[optimization problem]], and better algorithms can be designed and implemented with more careful thought and clever techniques. Naive algorithms are easy to discover, often easy to prove correct, and often immediately obvious to the problem solver. They are often based on simple [[simulation]] or on [[brute force]] generation of candidate solutions with little or no attempt at optimization. Despite their inefficiency, naive algorithms are often the stepping stone to more efficient, perhaps even asymptotically optimal algorithms, especially when their efficiency can be improved by choosing more appropriate [[data structure]]s.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;An algorithm is said to be '''naive''' when it is simple and straightforward but does not exhibit a desirable level of [[Analysis of algorithms|efficiency]] (usually in terms of time, but also possibly memory) despite finding a correct solution or it does not find an optimal solution to an [[optimization problem]], and better algorithms can be designed and implemented with more careful thought and clever techniques. Naive algorithms are easy to discover, often easy to prove correct, and often immediately obvious to the problem solver. They are often based on simple [[simulation]] or on [[brute force]] generation of candidate solutions with little or no attempt at &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[[&lt;/ins&gt;optimization&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;]]&lt;/ins&gt;. Despite their inefficiency, naive algorithms are often the stepping stone to more efficient, perhaps even asymptotically optimal algorithms, especially when their efficiency can be improved by choosing more appropriate [[data structure]]s.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For example, the naive algorithm for [[string searching]] entails trying to match the needle at every possible position in the haystack, doing an &amp;lt;math&amp;gt;O(m)&amp;lt;/math&amp;gt; check at each step (where &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; is the length of the needle), giving an &amp;lt;math&amp;gt;O(mn)&amp;lt;/math&amp;gt; runtime (where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the length of the haystack). The realization that the check can be performed more efficiently using a hash function leads to the [[Rabin–Karp algorithm]]. The realization that preprocessing the needle can allow a failed attempt at matching to be used to rule out other possible positions leads to the [[Knuth–Morris–Pratt algorithm]]. The realization that preprocessing the haystack can allow needles to be &amp;quot;looked up&amp;quot; in the haystack rather than searched for in a linear fashion leads to the [[suffix tree]] data structure which reduces string search to mere traversal. All of these algorithms are more efficient than the naive algorithm.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For example, the naive algorithm for [[string searching]] entails trying to match the needle at every possible position in the haystack, doing an &amp;lt;math&amp;gt;O(m)&amp;lt;/math&amp;gt; check at each step (where &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; is the length of the needle), giving an &amp;lt;math&amp;gt;O(mn)&amp;lt;/math&amp;gt; runtime (where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the length of the haystack). The realization that the check can be performed more efficiently using a hash function leads to the [[Rabin–Karp algorithm]]. The realization that preprocessing the needle can allow a failed attempt at matching to be used to rule out other possible positions leads to the [[Knuth–Morris–Pratt algorithm]]. The realization that preprocessing the haystack can allow needles to be &amp;quot;looked up&amp;quot; in the haystack rather than searched for in a linear fashion leads to the [[suffix tree]] data structure which reduces string search to mere traversal. All of these algorithms are more efficient than the naive algorithm.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Algorithms]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Algorithms]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Brian</name></author>	</entry>

	<entry>
		<id>http://wcipeg.com/wiki/index.php?title=Naive_algorithm&amp;diff=1216&amp;oldid=prev</id>
		<title>Brian: oops</title>
		<link rel="alternate" type="text/html" href="http://wcipeg.com/wiki/index.php?title=Naive_algorithm&amp;diff=1216&amp;oldid=prev"/>
				<updated>2011-03-24T19:10:51Z</updated>
		
		<summary type="html">&lt;p&gt;oops&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 19:10, 24 March 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;An algorithm is said to be '''naive''' when it is simple and straightforward but does not exhibit a desirable level of [[Analysis of algorithms|efficiency]] (usually in terms of time, but also possibly memory) despite finding a correct solution or it does not find an optimal solution to an [[optimization problem]], and better algorithms can be designed and implemented with more careful thought and clever techniques. Naive algorithms are easy to discover, often easy to prove correct, and often immediately obvious to the problem solver. They are often based on simple [[simulation]] or on [[brute force]] generation of candidate solutions with little or no attempt at optimization. Despite their inefficiency, naive algorithms are often the stepping stone to more efficient, perhaps even asymptotically optimal algorithms, especially when their efficiency can be improved by choosing more appropriate [[data structure]]s.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;An algorithm is said to be '''naive''' when it is simple and straightforward but does not exhibit a desirable level of [[Analysis of algorithms|efficiency]] (usually in terms of time, but also possibly memory) despite finding a correct solution or it does not find an optimal solution to an [[optimization problem]], and better algorithms can be designed and implemented with more careful thought and clever techniques. Naive algorithms are easy to discover, often easy to prove correct, and often immediately obvious to the problem solver. They are often based on simple [[simulation]] or on [[brute force]] generation of candidate solutions with little or no attempt at optimization. Despite their inefficiency, naive algorithms are often the stepping stone to more efficient, perhaps even asymptotically optimal algorithms, especially when their efficiency can be improved by choosing more appropriate [[data structure]]s.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For example, the naive algorithm for [[string searching]] entails trying to match the needle at every possible position in the haystack, doing an &amp;lt;math&amp;gt;O(m)&amp;lt;/math&amp;gt; check at each step (where &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; is the length of the needle), giving an &amp;lt;math&amp;gt;O(mn)&amp;lt;/math&amp;gt; runtime (where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the length of the haystack). The realization that the check can be performed more efficiently using a hash function leads to the [[Rabin–Karp algorithm]]. The realization that preprocessing the needle can allow a failed attempt at matching to be used to rule out other possible positions leads to the [[Knuth–Morris–Pratt algorithm]]. The realization that preprocessing the haystack can allow needles to be &amp;quot;looked up&amp;quot; in the haystack rather than searched for in a linear fashion leads to the [[&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Aho–Corasick algorithm&lt;/del&gt;]]. All of these algorithms are more efficient than the naive algorithm.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For example, the naive algorithm for [[string searching]] entails trying to match the needle at every possible position in the haystack, doing an &amp;lt;math&amp;gt;O(m)&amp;lt;/math&amp;gt; check at each step (where &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; is the length of the needle), giving an &amp;lt;math&amp;gt;O(mn)&amp;lt;/math&amp;gt; runtime (where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the length of the haystack). The realization that the check can be performed more efficiently using a hash function leads to the [[Rabin–Karp algorithm]]. The realization that preprocessing the needle can allow a failed attempt at matching to be used to rule out other possible positions leads to the [[Knuth–Morris–Pratt algorithm]]. The realization that preprocessing the haystack can allow needles to be &amp;quot;looked up&amp;quot; in the haystack rather than searched for in a linear fashion leads to the [[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;suffix tree&lt;/ins&gt;]] &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;data structure which reduces string search to mere traversal&lt;/ins&gt;. All of these algorithms are more efficient than the naive algorithm.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Algorithms]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Algorithms]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Brian</name></author>	</entry>

	<entry>
		<id>http://wcipeg.com/wiki/index.php?title=Naive_algorithm&amp;diff=1191&amp;oldid=prev</id>
		<title>Brian: Created page with &quot;An algorithm is said to be '''naive''' when it is simple and straightforward but does not exhibit a desirable level of efficiency (usually in terms of ...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wcipeg.com/wiki/index.php?title=Naive_algorithm&amp;diff=1191&amp;oldid=prev"/>
				<updated>2011-03-20T22:25:58Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;An algorithm is said to be &amp;#039;&amp;#039;&amp;#039;naive&amp;#039;&amp;#039;&amp;#039; when it is simple and straightforward but does not exhibit a desirable level of &lt;a href=&quot;/wiki/index.php?title=Analysis_of_algorithms&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Analysis of algorithms (page does not exist)&quot;&gt;efficiency&lt;/a&gt; (usually in terms of ...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;An algorithm is said to be '''naive''' when it is simple and straightforward but does not exhibit a desirable level of [[Analysis of algorithms|efficiency]] (usually in terms of time, but also possibly memory) despite finding a correct solution or it does not find an optimal solution to an [[optimization problem]], and better algorithms can be designed and implemented with more careful thought and clever techniques. Naive algorithms are easy to discover, often easy to prove correct, and often immediately obvious to the problem solver. They are often based on simple [[simulation]] or on [[brute force]] generation of candidate solutions with little or no attempt at optimization. Despite their inefficiency, naive algorithms are often the stepping stone to more efficient, perhaps even asymptotically optimal algorithms, especially when their efficiency can be improved by choosing more appropriate [[data structure]]s.&lt;br /&gt;
&lt;br /&gt;
For example, the naive algorithm for [[string searching]] entails trying to match the needle at every possible position in the haystack, doing an &amp;lt;math&amp;gt;O(m)&amp;lt;/math&amp;gt; check at each step (where &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; is the length of the needle), giving an &amp;lt;math&amp;gt;O(mn)&amp;lt;/math&amp;gt; runtime (where &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; is the length of the haystack). The realization that the check can be performed more efficiently using a hash function leads to the [[Rabin–Karp algorithm]]. The realization that preprocessing the needle can allow a failed attempt at matching to be used to rule out other possible positions leads to the [[Knuth–Morris–Pratt algorithm]]. The realization that preprocessing the haystack can allow needles to be &amp;quot;looked up&amp;quot; in the haystack rather than searched for in a linear fashion leads to the [[Aho–Corasick algorithm]]. All of these algorithms are more efficient than the naive algorithm.&lt;br /&gt;
&lt;br /&gt;
[[Category:Algorithms]]&lt;/div&gt;</summary>
		<author><name>Brian</name></author>	</entry>

	</feed>