Sorted array provide a complexity profile which make it suitable for collection with significantly more lookups that modifying operations:
- a compact memory footprint
- an efficient lookup complexity in O(log N)
- an efficient scan complexity since it depends on the lookup followed by a sequential scan of the array
- an insertion in O(N * log N) which is rather inefficient but remains acceptable if the operation is rather rare
3 flavors of generic sorted arrays for efficient lookup and paginated scans.
The official documentation can be found at github.com/jfsmig/go-bags