Content deleted Content added
m Fixed cites |
m Open access bot: url-access=subscription updated in citation with #oabot. |
||
(7 intermediate revisions by 5 users not shown) | |||
Line 2:
{{Refimprove|date=April 2021}}
In computing, a '''one-pass algorithm''' or '''single-pass algorithm''' is a [[streaming algorithm]] which reads its input exactly once.<ref name="frankfurt"/> 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.<ref name="sjsu"/> A one-pass algorithm generally requires ''O''(''n'') (see [[Big O Notation|'big O' notation]]) time and less than ''O''(''n'') storage (typically ''O''(1)), where ''n'' is the size of the input.<ref name="eds"/> An example of a one-pass algorithm is the Sondik [[partially observable
==Example problems solvable by one-pass algorithms==
Line 15:
* Count the number of times each symbol appears in the input.
* Find the most or least frequent elements.
* Sort the list according to some order on the symbols (possible since the and after number of symbols is limited).
* Find the maximum gap between two appearances of a given symbol.
Line 33:
== References==
<references>
<ref name="eds">{{Citation|last=Schweikardt|first=Nicole|title=One-Pass Algorithm|date=2009|url=https://doi.org/10.1007/978-0-387-39940-9_253|
<ref name="frankfurt">{{Cite web|last=Schweikardt|first=Nicole|title=One-Pass Algorithm|url=http://www.tks.informatik.uni-frankfurt.de/schweika/downloads/EncycDBS_OnePassAlgos.pdf
<ref name="sjsu">{{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
<ref name="pomdp">{{Cite web|url=http://www.pomdp.org/tutorial/sondik.html|title=Sondik's One-Pass Algorithm|website=www.pomdp.org}}</ref>
</references>
{{cs-stub}}
{{DEFAULTSORT:One-Pass Algorithm}}
|