8000 Add big O notation to the style guide (#1261) · python/devguide@d4552d0 · GitHub
[go: up one dir, main page]

Skip to content

Commit d4552d0

Browse files
authored
Add big O notation to the style guide (#1261)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
1 parent f398a50 commit d4552d0

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

documentation/style-guide.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,3 +225,20 @@ errors ("I made a mistake, therefore the docs must be wrong ..."). Typically,
225225
the documentation wasn't consulted until after the error was made. It is
226226
unfortunate, but typically no documentation edit would have saved the user from
227227
making false assumptions about the language ("I was surprised by ...").
228+
229+
Big *O* notation
230+
================
231+
232+
Big *O* notation is used to describe the performance of algorithms.
233+
234+
Use italics for the big *O* and variables. For example:
235+
236+
======================== ====================
237+
reStructuredText Rendered
238+
======================== ====================
239+
``*O*\ (1)`` *O*\ (1)
240+
``*O*\ (log *n*)`` *O*\ (log *n*)
241+
``*O*\ (*n*)`` *O*\ (*n*)
242+
``*O*\ (*n* log *n*)`` *O*\ (*n* log *n*)
243+
``*O*\ (*n*\ :sup:`2`)`` *O*\ (*n*\ :sup:`2`)
244+
======================== ====================

0 commit comments

Comments
 (0)
0