One-pass algorithm

In computing, a one-pass algorithm or single-pass algorithm is a streaming algorithm which reads its input exactly once. It does so by processing items in order, without unbounded 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. A one-pass algorithm generally requires O(n) (see 'big O' notation) time and less than O(n) storage (typically O(1)), where n is the size of the input. An example of a one-pass algorithm is the Sondik partially observable Markov decision process.

Example problems solvable by one-pass algorithms

Given any list as an input:

Given a list of numbers:

Given a list of symbols from an alphabet of k symbols, given in advance.

Example problems not solvable by one-pass algorithms

Given any list as an input:

Given a list of numbers:

The two-pass algorithms above are still streaming algorithms but not one-pass algorithms.

References

  1. ↑ Schweikardt, Nicole. "One-Pass Algorithm" (PDF). Retrieved 2021-07-01.
  2. ↑ Pollett, Chris (2005-03-14). "One and Two Pass Algorithms" (PDF). Retrieved 2021-07-01.
  3. ↑ Schweikardt, Nicole (2009), "One-Pass Algorithm", in LIU, LING; ÖZSU, M. TAMER (eds.), Encyclopedia of Database Systems, Boston, MA: Springer US, pp. 1948–1949, doi:10.1007/978-0-387-39940-9_253, ISBN 978-0-387-39940-9, retrieved 2021-04-13
  4. ↑ "Sondik's One-Pass Algorithm". www.pomdp.org.