# HomeWork ###### tags: dataStracture ## Write-up [big-O Note ](/e9ChynKNQvmbuPawjj9cpw) ## Implement Libraries > numpy > matplotlib Source Code https://colab.research.google.com/drive/12PS-XTzZnWRP0kpembKDaczcBr7wDni6?usp=sharing --- liner ![](https://i.imgur.com/Zt78FKm.png) log n ![](https://i.imgur.com/m7JeKSJ.png) n**2 ![](https://i.imgur.com/kijYhuZ.png) n**3 ![](https://i.imgur.com/0u2alGa.png) nlogn ![](https://i.imgur.com/pSppozd.png) [Reference link](https://sites.google.com/site/zsgititit/home/python-cheng-shi-she-ji/shi-yongpython-hui-zhi-yan-suan-fa-cheng-zhang-qu-shi-tu) ``` import math import numpy as np import matplotlib.pyplot as plt n = np.arange(1, 100, 1) y = [math.factorial(i) for i in n] plt.plot(n, y, label="O(n!)") y = [math.pow(2, i) for i in n] plt.plot(n, y , label="O(2**n)") y = [i*i*i for i in n] plt.plot(n, y, label="O(n**3)") y = [i*i for i in n] plt.plot(n, y, label="O(n**2)") y = [i*np.log(i) for i in n] plt.plot(n, y, label="O(n*log(n))") y = n plt.plot(n, y, label="O(n)") y = [np.log(i) for i in n] plt.plot(n, y, 'r', label="O(log(n))") plt.legend() plt.ylim(0, 5000) plt.show() ``` ![](https://i.imgur.com/W4fylFI.png) > [name=侯智晟]