encyclopegia.org

Output-sensitive algorithm

In computer science, an output-sensitive algorithm is an algorithm whose running time depends on the size of the output, instead of, or in addition to, the size of the input. For certain problems where the output size varies widely, for example from linear in the size of the input to quadratic in the size of the input, analyses that take the output size explicitly into account can produce better runtime bounds that differentiate algorithms that would otherwise have identical asymptotic complexity.

In computer science, an output-sensitive algorithm is an algorithm whose running time depends on the size of the output, instead of, or in addition to, the size of the input. For certain problems where the output size varies widely, for example from linear in the size of the input to quadratic in the size of the input, analyses that take the output size explicitly into account can produce better runtime bounds that differentiate algorithms that would otherwise have identical asymptotic complexity. def divide(number: int, divisor: int) -> tuple[int, int]: """Division by subtraction.""" if divisor == 0: raise ZeroDivisionError if number = divisor: q += 1 r -= divisor return q, r Example output: >>> divide(10, 2) (5, 0) >>> divide(10, 3) (3, 1) This algorithm takes Θ(Q) time, and so can be fast in scenarios where the quotient Q is known to be small. In cases where Q is large however, it is outperformed by more complex algorithms such as long division. ==See also== Lazy evaluation

References

No reference rows published for this article.

Cite this article

MLA

"Output-sensitive algorithm." encyclopegia.org, 2025, https://encyclopegia.org/wiki/output-sensitive-algorithm. Accessed 24 November 2026.

Chicago

"Output-sensitive algorithm." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/output-sensitive-algorithm.

APA

encyclopegia.org. (2025). Output-sensitive algorithm. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/output-sensitive-algorithm

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

Related articles

Myrna Williams

enwiki · references available

Stavrodromi

enwiki · references available

Seann triubhas

enwiki · references available

Whelan the Wrecker

enwiki · references available

Edward Houseman

enwiki · references available

All-Star Final Vote

enwiki · references available

JRY Trust

enwiki · references available

Catherine Walker (fashion designer)

enwiki · references available

Stephen Tingay

enwiki · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1327938154 · 0.5 · snapshot enwiki-001327938154

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.