samedi 27 juin 2015

Set to list operation asymptotic complexity

What is the asymptotic complexity of the set to list operation? Is it O(1) or O(n)? I mean this one:

a = set()
for i in range(1000000):
    a.add(i)
a = list(a)

Aucun commentaire:

Enregistrer un commentaire