Skip to content

Commit

Permalink
Edit code of examples
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaySimakov committed Jul 1, 2023
1 parent 101f9cf commit 575d5ff
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

Python library to measure the complexity of your algorithms using the following asymptotic notations:

- [Big O](https://en.wikipedia.org/wiki/Big_O_notation)
- [Big 惟 (omega)](https://en.wikipedia.org/wiki/Big_O_notation#Big_Omega_notation)
- [Big 螛 (theta)](https://en.wikipedia.org/?title=Big_Theta_notation&redirect=no)
- [Big O](https://en.wikipedia.org/wiki/Big_O_notation) - pycomplexity.BigO
- [Big 惟 (omega)](https://en.wikipedia.org/wiki/Big_O_notation#Big_Omega_notation) - pycomplexity.BigOmega
- [Big 螛 (theta)](https://en.wikipedia.org/?title=Big_Theta_notation&redirect=no) - pycomplexity.BigTheta

## Installation

Expand All @@ -21,7 +21,7 @@ $ pip install pycomplexity

## Get started

Simple examples of using Big-O notation. Here are the most popular and common examples.
Simple examples of using Big O notation. Here are the most popular and common examples.

### Basic example

Expand All @@ -48,15 +48,18 @@ Function attributes: no attributes
Memory of algorithm: O(1)
```

Or when you set ``full_report=False`` the console ``output``:

```
小omplexity of algorithm: O(1)
Memory of algorithm: O(1)
```

### Attributes vs Variables

Using ``arr`` as variable:

```python
from pycomplexity import BigO

big_o = BigO(full_report=False)

@big_o.complexity
def your_func():
count = 0
Expand All @@ -66,7 +69,7 @@ def your_func():
return count
```

Console returns ``output``:
Console ``output``:

```
小omplexity of algorithm: O(1)
Expand All @@ -76,11 +79,6 @@ Memory of algorithm: O(1)
Using ``arr`` as attribute:

```python
from typing import List
from pycomplexity import BigO

big_o = BigO(full_report=False)

@big_o.complexity
def your_func(arr: List[int]) -> int:
# not fixed length
Expand All @@ -90,7 +88,7 @@ def your_func(arr: List[int]) -> int:
return count
```

Console returns ``output``:
Console ``output``:

```
小omplexity of algorithm: O(N)
Expand Down

0 comments on commit 575d5ff

Please sign in to comment.