Skip to content

Commit

Permalink
Add big O notation to the style guide
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Jan 10, 2024
1 parent f398a50 commit 2e06856
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions documentation/style-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,25 @@ 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:

.. list-table::

* - 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 2e06856

Please sign in to comment.