encyclopegia.org

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.

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: Count the number of elements. Given a list of numbers: Find the k largest or smallest elements, k given in advance. Find the sum, mean, variance and standard deviation of the elements of the list. See also Algorithms for calculating variance. Given a list of symbols from an alphabet of k symbols, given in advance. 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. ==Example problems not solvable by one-pass algorithms== Given any list as an input: Find the nth element from the end (or report that the list has fewer than n elements). 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. Given a list of numbers: Find the median. Find the modes (This is not the same as finding the most frequent symbol from a limited alphabet). Sort the list. 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. The two-pass algorithms above are still streaming algorithms but not one-pass algorithms. == References==

References

No reference rows published for this article.

Cite this article

MLA

"one-pass algorithm." encyclopegia.org, 2025, https://encyclopegia.org/wiki/one-pass-algorithm. Accessed 24 November 2026.

Chicago

"one-pass algorithm." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/one-pass-algorithm.

APA

encyclopegia.org. (2025). one-pass algorithm. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/one-pass-algorithm

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Oaklisp

stub · references available

Offa's Country

stub · references available

Ol Doinyo Orok

stub · references available

Old Regular Baptists

stub · references available

ongoing series

stub · references available
CC BY-SA 4.0 · tier1-factual · https://en.wikipedia.org/w/index.php?oldid=1298046753 · 0.55 · snapshot one-pass-algorithm-799574-c1880b6e7dbfad9b · QID Q7092332

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.