Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

128
Vistas
collections.js - differance between SortedMap and SortedArrayMap

I was searching for a sorted map in javascript and found collections.js's implementation - SortedMap. I also see that they have something called SortedArrayMap.

In the description of SortedArrayMap it says:

A map of key value pairs, sorted by key, backed by an array.

(Source)

And in the description of SortedMap it says:

A map with entries sorted by key.

What exactly does backed by an array mean? and what is the difference between it and the normal SortedMap?

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

At first glance, SortedArrayMap uses a binary search strategy to maintain the order of the entries and is backed by an array, which means that use an array as a basic data structure(to maintain data of key). So that means in the end, that it uses a map based on SortedArray class.

However, SortedMap is a general key/value collection, where you can access values with their relative key(quick access rather than an array order).

Anyway, if you want to dive a bit more into this topic, you can find a very good explanation on the is the official website of collections.js,

about 4 years ago · Juan Pablo Isaza Denunciar

0

As stated on http://www.collectionsjs.com/map, maps are different as they work like dictionaries but accepting even objects as a key.

Reading the Dict documentation on http://www.collectionsjs.com/dict we understand that:

A dictionary is a specialized map. The keys are required to be strings.

An array is simply a data structure where you can insert anything using a simple push(thingToInsert). Items inserted into an Array are just values without a key to point to them.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda