Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

193
Visualizações
How does javascript Set can keep the order of insertion and still have 0(1) lookup "Set.has()"?

I have been studying data structures and I do get that Set use implementation similar to hash tables, so the input value + the hash algorithm will create a index where the value is stored...

This will yield the ability to search for such value later in constant time o(1) (disregarding collisions) however this comes at expense of not having an ordered collection since the positions in the collection are computed during insertion instead of order insertion,

So the question is how Set can keep the order and still have constant time on the lookup method Set.has()?

Thank you in advance!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda