On 3/13/16 4:33 AM, Jonathan M Davis via Digitalmars-d-learn wrote:
On Sunday, March 13, 2016 02:35:27 stunaep via Digitalmars-d-learn wrote:
Is there any sorted map in D? I need a map and I need to be able
to get the highest key in the map. In java I would use a TreeMap
and use map.lastKey
On Sunday, 13 March 2016 at 14:11:14 UTC, Anonymouse wrote:
On Sunday, 13 March 2016 at 13:44:35 UTC, cym13 wrote:
Note that implementing an (admitedly not perfect) ordered
associative array yourself really isn't much work:
https://github.com/cym13/miscD/blob/master/ordered_aa.d
Unsigned
On Sunday, 13 March 2016 at 13:44:35 UTC, cym13 wrote:
Note that implementing an (admitedly not perfect) ordered
associative array yourself really isn't much work:
https://github.com/cym13/miscD/blob/master/ordered_aa.d
Unsigned integer comparison with -1 in the remove function, by
the way.
On Sunday, 13 March 2016 at 10:06:24 UTC, stunaep wrote:
On Sunday, 13 March 2016 at 08:33:43 UTC, Jonathan M Davis
wrote:
On Sunday, March 13, 2016 02:35:27 stunaep via
Digitalmars-d-learn wrote:
[...]
The closest that we have in Phobos at the moment is
RedBlackTree in std.container. Its
On Sunday, 13 March 2016 at 08:33:43 UTC, Jonathan M Davis wrote:
On Sunday, March 13, 2016 02:35:27 stunaep via
Digitalmars-d-learn wrote:
[...]
The closest that we have in Phobos at the moment is
RedBlackTree in std.container. Its API is geared towards sets,
not maps, but you can get it
On Sunday, March 13, 2016 02:35:27 stunaep via Digitalmars-d-learn wrote:
> Is there any sorted map in D? I need a map and I need to be able
> to get the highest key in the map. In java I would use a TreeMap
> and use map.lastKey(), but since associative arrays are not
> sorted that
Is there any sorted map in D? I need a map and I need to be able
to get the highest key in the map. In java I would use a TreeMap
and use map.lastKey(), but since associative arrays are not
sorted that would be O(n). I know about RedBlackTree, but that's
a set and it must be a map.