################################################################################
################################################################################
#   CONJECTURES DE COMPLEXITE
################################################################################
################################################################################

import numpy as np, numpy.random as rd, time, matplotlib.pyplot as plt

################################################################################
#   
################################################################################


N=10000
tN=range(N)
dico={}
t_time=[]
for k in range(N):
    deb=time.time()
    dico[k]=k
    fin=time.time()
    t_time.append(fin-deb)
plt.plot(tN,t_time)
plt.show()

################################################################################
#   
################################################################################


N=10000
tN=range(N)
dico={}
t_time=[]
for k in range(N):
    deb=time.time()
    if k not in dico:
        dico[k]=k
    fin=time.time()
    t_time.append(fin-deb)
plt.plot(tN,t_time)
plt.show()


################################################################################
#   
################################################################################


N=10000
tN=range(N)
dico={}
t_time=[]
for k in range(N):
    tirage=rd.randint(1,100)
    deb=time.time()
    if tirage  in dico:
        dico[tirage].append(k)
    else:
        dico[tirage]=[k]
    fin=time.time()
    t_time.append(fin-deb)
plt.plot(tN,t_time)
plt.show()
