Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Italicization of single letter variables and specifically Big O notation #24

Open
suragch opened this issue Jan 11, 2022 · 2 comments
Open

Comments

@suragch
Copy link

suragch commented Jan 11, 2022

I assume it is correct to italicize single letter variables that are not specifically used in code:

  • There are n items in the array. (correct)
  • There are n items in the array. (incorrect)

Does this apply to the O used in Big O notation? Here are some common examples:

  • O(1)
  • O(n)
  • O(n²)
  • O(log n)
  • O(n log n)

Are the following correct:

  • O(1)
  • O(n)
  • O(_n_²)
  • O(log n)
  • O(n log n)
_O_(1)
_O_(_n_)
_O_(_n_²)
_O_(log _n_)
_O_(_n_ log _n_)
@suragch
Copy link
Author

suragch commented Jan 13, 2022

The official guides don't seem to support it.

But also note that the current version of Data Structures and Algorithms in Swift does use italics. And see the usage here: https://en.wikipedia.org/wiki/Big_O_notation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant