Sun, 23 Nov 2025 13:15:19 +0100
optimize sorted insertion by using the infimum instead of the supremum
The reason is that the supremum returns the equal element with the smallest index, and we want the largest.
Therefore, we use the infimum, which already gives us the largest index when there are equal elements, and increase the index by one. The infimum is also guaranteed to exist in that case.
# Data Structures UCX provides a [linked list](linked_list.h.md) and [array list](array_list.h.md) implementation over a common [list](list.h.md) interface, as well as a [hash nap](hash_map.h.md) implementation over a [map](map.h.md) interface, and a basic [tree](tree.h.md) implementation. Another special collection is the [key/value-list](kv_list.h.md) that combines both the list and the map interfaces. Additionally, UCX provides an abstraction for [iterators](iterator.h.md) that work with all collection types, and plain C arrays. The design goal of this API was to provide high-level abstractions (functions in lowerCamelCase) and low-level implementations (functions in snake_case). This way you can freely choose whether to use the predefined implementations for the various collection types or to implement your own collections using the low-level API.