<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=One-pass_algorithm</id>
	<title>One-pass algorithm - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=One-pass_algorithm"/>
	<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=One-pass_algorithm&amp;action=history"/>
	<updated>2026-10-26T00:52:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://debianws.lexgopc.com/wiki143/index.php?title=One-pass_algorithm&amp;diff=4024227&amp;oldid=prev</id>
		<title>imported&gt;OAbot: Open access bot: url-access=subscription updated in citation with #oabot.</title>
		<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=One-pass_algorithm&amp;diff=4024227&amp;oldid=prev"/>
		<updated>2025-06-30T05:40:46Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/OABOT&quot; class=&quot;extiw&quot; title=&quot;wikipedia:OABOT&quot;&gt;Open access bot&lt;/a&gt;: url-access=subscription updated in citation with #oabot.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Short description|Type of streaming algorithm}}&lt;br /&gt;
{{Refimprove|date=April 2021}}&lt;br /&gt;
&lt;br /&gt;
In computing, a &amp;#039;&amp;#039;&amp;#039;one-pass algorithm&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;single-pass algorithm&amp;#039;&amp;#039;&amp;#039; is a [[streaming algorithm]] which reads its input exactly once.&amp;lt;ref name=&amp;quot;frankfurt&amp;quot;/&amp;gt; It does so by processing items in order, without unbounded [[Buffer (computer science)|buffering]]; it reads a block into an [[input buffer]], processes it, and moves the result into an output buffer for each step in the process.&amp;lt;ref name=&amp;quot;sjsu&amp;quot;/&amp;gt; A one-pass algorithm generally requires &amp;#039;&amp;#039;O&amp;#039;&amp;#039;(&amp;#039;&amp;#039;n&amp;#039;&amp;#039;) (see [[Big O Notation|&amp;#039;big O&amp;#039; notation]]) time and less than &amp;#039;&amp;#039;O&amp;#039;&amp;#039;(&amp;#039;&amp;#039;n&amp;#039;&amp;#039;) storage (typically &amp;#039;&amp;#039;O&amp;#039;&amp;#039;(1)), where &amp;#039;&amp;#039;n&amp;#039;&amp;#039; is the size of the input.&amp;lt;ref name=&amp;quot;eds&amp;quot;/&amp;gt; An example of a one-pass algorithm is the Sondik [[partially observable Markov decision process]].&amp;lt;ref name=&amp;quot;pomdp&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example problems solvable by one-pass algorithms==&lt;br /&gt;
Given any list as an input:&lt;br /&gt;
* Count the number of elements.&lt;br /&gt;
&lt;br /&gt;
Given a list of numbers:&lt;br /&gt;
* Find the &amp;#039;&amp;#039;k&amp;#039;&amp;#039; largest or smallest elements, &amp;#039;&amp;#039;k&amp;#039;&amp;#039; given in advance.&lt;br /&gt;
* Find the [[summation|sum]], [[mean]], [[variance]] and [[standard deviation]] of the elements of the list. See also [[Algorithms for calculating variance]].&lt;br /&gt;
&lt;br /&gt;
Given a list of symbols from an alphabet of &amp;#039;&amp;#039;k&amp;#039;&amp;#039; symbols, given in advance.&lt;br /&gt;
* Count the number of times each symbol appears in the input.&lt;br /&gt;
* Find the most or least frequent elements.&lt;br /&gt;
* Sort the list according to some order on the symbols (possible since the and after number of symbols is limited).&lt;br /&gt;
* Find the maximum gap between two appearances of a given symbol.&lt;br /&gt;
&lt;br /&gt;
==Example problems not solvable by one-pass algorithms==&lt;br /&gt;
Given any list as an input:&lt;br /&gt;
* Find the &amp;#039;&amp;#039;n&amp;#039;&amp;#039;th element from the end (or report that the list has fewer than &amp;#039;&amp;#039;n&amp;#039;&amp;#039; elements).&lt;br /&gt;
* Find the middle element of the list.  However, this is solvable with two passes: Pass 1 counts the elements and pass 2 picks out the middle one.&lt;br /&gt;
&lt;br /&gt;
Given a list of numbers:&lt;br /&gt;
* Find the [[median]].&lt;br /&gt;
* Find the [[mode (statistics)|modes]] (This is not the same as finding the most frequent symbol from a limited alphabet).&lt;br /&gt;
* Sort the list.&lt;br /&gt;
* Count the number of items greater than or less than the [[mean]].  However, this can be done in constant memory with two passes: Pass 1 finds the average and pass 2 does the counting.&lt;br /&gt;
&lt;br /&gt;
The two-pass algorithms above are still [[streaming algorithm|streaming algorithms]] but not one-pass algorithms.&lt;br /&gt;
&lt;br /&gt;
== References==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;eds&amp;quot;&amp;gt;{{Citation|last=Schweikardt|first=Nicole|title=One-Pass Algorithm|date=2009|url=https://doi.org/10.1007/978-0-387-39940-9_253|encyclopedia=Encyclopedia of Database Systems|pages=1948–1949|editor-last=LIU|editor-first=LING|editor-link=Ling Liu (computer scientist)|place=Boston, MA|publisher=Springer US|language=en|doi=10.1007/978-0-387-39940-9_253|isbn=978-0-387-39940-9|access-date=2021-04-13|editor2-last=ÖZSU|editor2-first=M. TAMER|url-access=subscription}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;frankfurt&amp;quot;&amp;gt;{{Cite web|last=Schweikardt|first=Nicole|title=One-Pass Algorithm|url=http://www.tks.informatik.uni-frankfurt.de/schweika/downloads/EncycDBS_OnePassAlgos.pdf|access-date=2021-07-01}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;sjsu&amp;quot;&amp;gt;{{Cite web|last=Pollett|first=Chris|date=2005-03-14|title=One and Two Pass Algorithms|url=http://www.cs.sjsu.edu/faculty/pollett/157b.12.05s/Lec14032005.pdf|access-date=2021-07-01}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;pomdp&amp;quot;&amp;gt;{{Cite web|url=http://www.pomdp.org/tutorial/sondik.html|title=Sondik&amp;#039;s One-Pass Algorithm|website=www.pomdp.org}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{cs-stub}}&lt;br /&gt;
&lt;br /&gt;
{{DEFAULTSORT:One-Pass Algorithm}}&lt;br /&gt;
[[Category:Streaming algorithms]]&lt;/div&gt;</summary>
		<author><name>imported&gt;OAbot</name></author>
	</entry>
</feed>