ArrayMap
keeps its mappings in an array data structure — an integer array of hash codes for each item, and an Object array of the key -> value pairs
.
Where ArrayList
is a List. Resizable-array implementation of the List interface. Implements all optional list operations, and permits all elements, including null.
FYI
ArrayMap is a generic key->value
mapping data structure that is designed to be more memory efficient than a traditional HashMap
.
Note that ArrayMap implementation is not intended to be appropriate for
data structures that may contain large numbers of items. It is
generally slower than a traditional HashMap, since lookups require a
binary search and adds and removes require inserting and deleting
entries in the array. For containers holding up to hundreds of items,
the performance difference is not significant, less than 50%.
3
solved What are the differences between ArrayList and ArrayMap?