[Python] what is the maximum length possible of a hashset in python?

Discussão em 'Python' iniciado por Stack, Maio 3, 2025.

  1. Stack

    Stack Membro Participativo

    m = set()
    for i in range(10**7):
    m.add(i)

    print(999999 in m)


    above code runs fast (excluding the for loop inserting elements to hash set which takes a while)

    what is the maximum length possible of a hashset in python that still search in constant time?

    Continue reading...

Compartilhe esta Página