Skip to content

Commit

Permalink
Add big O notation to the style guide (#1261)
Browse files Browse the repository at this point in the history
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
  • Loading branch information
hugovk and hugovk committed Jan 14, 2024
1 parent f398a50 commit d4552d0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions documentation/style-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,20 @@ errors ("I made a mistake, therefore the docs must be wrong ..."). Typically,
the documentation wasn't consulted until after the error was made. It is
unfortunate, but typically no documentation edit would have saved the user from
making false assumptions about the language ("I was surprised by ...").

Big *O* notation
================

Big *O* notation is used to describe the performance of algorithms.

Use italics for the big *O* and variables. For example:

======================== ====================
reStructuredText Rendered
======================== ====================
``*O*\ (1)`` *O*\ (1)
``*O*\ (log *n*)`` *O*\ (log *n*)
``*O*\ (*n*)`` *O*\ (*n*)
``*O*\ (*n* log *n*)`` *O*\ (*n* log *n*)
``*O*\ (*n*\ :sup:`2`)`` *O*\ (*n*\ :sup:`2`)
======================== ====================

0 comments on commit d4552d0

Please sign in to comment.