Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/play3rzer0/bigo

BigO Notation Examples
https://github.com/play3rzer0/bigo

algorithms basic-programming big-o bubble-sort computer-science linear-search python time-complexity

Last synced: about 2 hours ago
JSON representation

BigO Notation Examples

Awesome Lists containing this project

README

        

# BigO

The following are examples used in the Big O article.

All these examples require Python 2.7 and Higher in order to work properly.

The following examples are:

1. Binary Search (binary.py)
2. Bubblesort (bubblesort.py)
3. Constant (constant.py)
4. Linear Search (linear.py)

O(1) is constant, no matter how many elements are added the resulting operation will always be the same time.

O(N) is linear, it increases operations as the number of elements increases in direct proportion.

O(Log N) is logarithmic or half of linear time, it halves the number of operations required given the same elements as O(n).

O(N²) shows the worst case scenario as operations increase steeply with the increase in number of elements, or quadratic time.