Skip to content

Instantly share code, notes, and snippets.

@toransahu
Created August 30, 2018 10:21
Show Gist options
  • Save toransahu/a0d86054f5df72cc15037cda50a46800 to your computer and use it in GitHub Desktop.
Save toransahu/a0d86054f5df72cc15037cda50a46800 to your computer and use it in GitHub Desktop.
Plot graph from polynomial equations; Usefull to compare time complexity order
"""
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