Wednesday, October 8, 2025

Data structure taxonomy

There are quite a few standard data structures in programming. I’m not even talking about complicated things like red-black trees. These are basic data structures.

Sequence / Array / Vector
Keys: Numeric. May be fixed or flexible in number.
Values: One per key. May be fixed or flexible in type.
Pick: Any.

Struct / Record
Keys: Named. Fixed in number.
Values: One per key. Type variable per key.
Pick: Any or all.

Tuple
Keys: Numeric. Fixed in number. May be named.
Values: One per key. Type variable per key.
Pick: Any or all.

Table / Dictionary
Keys: Variable in format. Flexible in number (usually).
Values: One per key (generally). May be fixed or flexible in type.
Pick: Any.

Set
Keys: Variable in format. Flexible in number (usually).
Values: None (usually).
Pick: Any.

Enumeration
Keys: Named, fixed in number (usually).
Values: None (usually).
Pick: At most one.

Union / Tagged Union
Keys: Named and/or Enum. Fixed in number.
Values: One per key. Fixed in type per key.
Pick: At most one.

Linked List
Keys: None (usually).
Values: Completely flexible in number. Type may be fixed or flexible.
Pick: Iterate through the elements one value at a time.