odict
An odict, short for ordered dictionary, is a data structure that combines the key-value semantics of a dictionary with the requirement to preserve the order in which keys were inserted. In an odict, keys are unique as in a normal map, but iteration over the items yields entries in insertion order rather than an arbitrary or undefined order.
Typical implementations use a hash map for fast key lookup and a linked list (or another sequencing
In Python, the term is closely associated with collections.OrderedDict, which offers features such as moving an
Other languages provide similar types, such as LinkedHashMap in Java and Map-like structures in JavaScript that
Common use cases include preserving key order when serializing to JSON or YAML, maintaining stable configuration