Summary
An
ordered_array stores elements in
ascending_order or
descending_order by value. Elements occupy
contiguous_memory. The key advantage is fast
binary_search with
time_complexity O(log n). Traversal is predictable and cache friendly. However,
insertion and
deletion are O(n) because many items may shift.
duplicates can be allowed or disallowed by policy. Indices are zero based. Typical uses are lookup tables, ID lists, and ranges that change rarely. Remember to keep the array sorted after updates to preserve search speed.