- So, I might define a linear array like so:
- A linear array is a collection of key-value pairs that only allows integers as key names: e.g. 1, 2, 3.
- The typical minimum key name is 0 or 1 (0-based arrays or 1-based arrays).
- AHK v1 arrays are 1-based when using the [] syntax, although the AHK v1 basic object allows 0 and negative integers to be the minimum.
- The typical maximum key name is some large power of 2 minus 1.
- Depending on the specification for the array, or how the array variable is defined: the maximum key name is fixed at loadtime, or, the array size can be changed at runtime.
- Gaps are allowed: i.e. if by gaps you mean: keys that have no value.
- Associative arrays are similar, although there is more flexibility in what you can have as key names e.g. strings.
- Here is an interesting discussion of sparse arrays v. dense arrays:
javascript - What exactly is a dense array? - Stack Overflow
https://stackoverflow.com/questions/39030196/what-exactly-is-a-dense-array
- I would also check this link that just me posted:
Data Structures In Java - Linear Array
https://www.c-sharpcorner.com/article/data-structure-linear-array/
- Going over various sources, it's actually very difficult to say anything that doesn't have caveats.
- E.g. what is dense, what is a gap, is a linear array strictly: an area of memory with items of a fixed size?