Created
August 30, 2018 10:21
-
-
Save toransahu/a0d86054f5df72cc15037cda50a46800 to your computer and use it in GitHub Desktop.
Plot graph from polynomial equations; Usefull to compare time complexity order
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Plot graph from polynomial equations; Usefull to compare time complexity order. | |
Prerequisites: | |
pip install numpy pandas matplotlib ipython | |
Execution: | |
python -m IPython script.py | |
""" | |
import pandas as pd | |
from matplotlib import pyplot as plt | |
from math import * | |
x = range(1, 11) | |
y = [n * log(n,2) for n in x ] | |
plt.plot(x,y) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment