Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
ah-convert.H
Go to the documentation of this file.
1
2/*
3 Aleph_w
4
5 Data structures & Algorithms
6 version 2.0.0b
7 https://github.com/lrleon/Aleph-w
8
9 This file is part of Aleph-w library
10
11 Copyright (c) 2002-2026 Leandro Rabindranath Leon
12
13 Permission is hereby granted, free of charge, to any person obtaining a copy
14 of this software and associated documentation files (the "Software"), to deal
15 in the Software without restriction, including without limitation the rights
16 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17 copies of the Software, and to permit persons to whom the Software is
18 furnished to do so, subject to the following conditions:
19
20 The above copyright notice and this permission notice shall be included in all
21 copies or substantial portions of the Software.
22
23 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29 SOFTWARE.
30*/
31
32
116#ifndef AH_CONVERT_H
117#define AH_CONVERT_H
118
119#include <deque>
120#include <initializer_list>
121#include <set>
122#include <map>
123#include <utility>
124#include <tpl_array.H>
125#include <tpl_dynArray.H>
126#include <tpl_dynDlist.H>
127#include <tpl_dynSetTree.H>
128#include <tpl_dynSetHash.H>
129#include <tpl_dynMapTree.H>
130#include <tpl_dynMapOhash.H>
131
132namespace Aleph
133{
134
146template <class T>
147[[nodiscard]] DynList<T> to_DynList(const Array<T> & a)
148{
149 return a.template maps<T>([] (const auto & item) { return item; });
150}
151
166template <class C>
168{
170 for (auto it = c.get_it(); it.has_curr(); it.next_ne())
171 ret.append(it.get_curr());
172 return ret;
173}
174
186template <class T>
188{
190 for (size_t i = 0; i < a.size(); ++i)
191 ret.append(a(i));
192 return ret;
193}
194
206template <class T>
208{
210 for (auto it = l.get_it(); it.has_curr(); it.next_ne())
211 ret.append(it.get_curr());
212 return ret;
213}
214
227template <class C>
228[[nodiscard]] std::vector<typename C::Item_Type> to_vector(const C & c)
229{
230 std::vector<typename C::Item_Type> ret;
231 if constexpr (requires { c.size(); })
232 ret.reserve(c.size());
233 for (auto it = c.get_it(); it.has_curr(); it.next_ne())
234 ret.push_back(it.get_curr());
235 return ret;
236}
237
249template <class T>
250[[nodiscard]] DynList<T> vector_to_DynList(const std::vector<T> & v)
251{
253 for (const auto & item : v)
254 ret.append(item);
255 return ret;
256}
257
269template <class T>
270[[nodiscard]] Array<T> vector_to_Array(const std::vector<T> & v)
271{
273 ret.reserve(v.size());
274 for (const auto & item : v)
275 ret.append(item);
276 return ret;
277}
278
290template <class T>
291[[nodiscard]] DynArray<T> vector_to_DynArray(const std::vector<T> & v)
292{
294 for (const auto & item : v)
295 ret.append(item);
296 return ret;
297}
298
312template <class C>
314{
316 for (auto it = c.get_it(); it.has_curr(); it.next_ne())
317 ret.append(it.get_curr());
318 return ret;
319}
320
332template <class T>
334{
336 for (size_t i = 0; i < a.size(); ++i)
337 ret.append(a(i));
338 return ret;
339}
340
352template <class T>
354{
356 for (size_t i = 0; i < a.size(); ++i)
357 ret.append(a(i));
358 return ret;
359}
360
373template <class C>
374[[nodiscard]] std::deque<typename C::Item_Type> to_deque(const C & c)
375{
376 std::deque<typename C::Item_Type> ret;
377 for (auto it = c.get_it(); it.has_curr(); it.next_ne())
378 ret.push_back(it.get_curr());
379 return ret;
380}
381
393template <class T>
394[[nodiscard]] DynList<T> deque_to_DynList(const std::deque<T> & d)
395{
397 for (const auto & item : d)
398 ret.append(item);
399 return ret;
400}
401
413template <class T>
414[[nodiscard]] Array<T> deque_to_Array(const std::deque<T> & d)
415{
417 ret.reserve(d.size());
418 for (const auto & item : d)
419 ret.append(item);
420 return ret;
421}
422
434template <class T>
435[[nodiscard]] DynArray<T> deque_to_DynArray(const std::deque<T> & d)
436{
438 for (const auto & item : d)
439 ret.append(item);
440 return ret;
441}
442
443// ==================== DynDlist Conversions ====================
444
456template <class T>
458{
460 l.for_each([&ret](const T & item) { ret.append(item); });
461 return ret;
462}
463
475template <class T>
477{
479 l.for_each([&ret](const T & item) { ret.append(item); });
480 return ret;
481}
482
494template <class T>
496{
498 l.for_each([&ret](const T & item) { ret.append(item); });
499 return ret;
500}
501
513template <class T>
515{
517 for (size_t i = 0; i < a.size(); ++i)
518 ret.append(a(i));
519 return ret;
520}
521
533template <class T>
534[[nodiscard]] DynDlist<T> vector_to_DynDlist(const std::vector<T> & v)
535{
537 for (const auto & item : v)
538 ret.append(item);
539 return ret;
540}
541
542// ==================== Move Semantics Conversions ====================
543
556template <class T>
557[[nodiscard]] DynList<T> vector_to_DynList(std::vector<T> && v)
558{
560 for (auto & item : v)
561 ret.append(std::move(item));
562 return ret;
563}
564
577template <class T>
578[[nodiscard]] Array<T> vector_to_Array(std::vector<T> && v)
579{
581 for (auto & item : v)
582 ret.append(std::move(item));
583 return ret;
584}
585
598template <class T>
600{
602 for (auto & item : v)
603 ret.append(std::move(item));
604 return ret;
605}
606
619template <class T>
621{
623 for (auto & item : v)
624 ret.append(std::move(item));
625 return ret;
626}
627
628// ==================== std::set Conversions ====================
629
643template <class T, class Compare, class Alloc>
644[[nodiscard]] DynList<T> set_to_DynList(const std::set<T, Compare, Alloc> & s)
645{
647 for (const auto & item : s)
648 ret.append(item);
649 return ret;
650}
651
665template <class T, class Compare, class Alloc>
666[[nodiscard]] Array<T> set_to_Array(const std::set<T, Compare, Alloc> & s)
667{
669 ret.reserve(s.size());
670 for (const auto & item : s)
671 ret.append(item);
672 return ret;
673}
674
688template <class T, class Compare, class Alloc>
689[[nodiscard]] DynArray<T> set_to_DynArray(const std::set<T, Compare, Alloc> & s)
690{
692 for (const auto & item : s)
693 ret.append(item);
694 return ret;
695}
696
708template <class C>
709[[nodiscard]] std::set<typename C::Item_Type> to_set(const C & c)
710{
711 std::set<typename C::Item_Type> ret;
712 for (auto it = c.get_it(); it.has_curr(); it.next_ne())
713 ret.insert(it.get_curr());
714 return ret;
715}
716
717// ==================== std::map Conversions ====================
718
733template <class K, class V, class Compare, class Alloc>
735map_to_DynList(const std::map<K, V, Compare, Alloc> & m)
736{
738 for (const auto & [key, value] : m)
739 ret.append(std::make_pair(key, value));
740 return ret;
741}
742
757template <class K, class V, class Compare, class Alloc>
759map_to_Array(const std::map<K, V, Compare, Alloc> & m)
760{
762 ret.reserve(m.size());
763 for (const auto & [key, value] : m)
764 ret.append(std::make_pair(key, value));
765 return ret;
766}
767
782template <class K, class V, class Compare, class Alloc>
783[[nodiscard]] DynList<K> map_keys_to_DynList(const std::map<K, V, Compare, Alloc> & m)
784{
786 for (const auto & [key, value] : m)
787 ret.append(key);
788 return ret;
789}
790
805template <class K, class V, class Compare, class Alloc>
806[[nodiscard]] DynList<V> map_values_to_DynList(const std::map<K, V, Compare, Alloc> & m)
807{
809 for (const auto & [key, value] : m)
810 ret.append(value);
811 return ret;
812}
813
814// ==================== initializer_list Conversions ====================
815
832template <class T>
833[[nodiscard]] DynList<T> init_to_DynList(std::initializer_list<T> il)
834{
836 for (const auto & item : il)
837 ret.append(item);
838 return ret;
839}
840
857template <class T>
858[[nodiscard]] Array<T> init_to_Array(std::initializer_list<T> il)
859{
861 for (const auto & item : il)
862 ret.append(item);
863 return ret;
864}
865
882template <class T>
883[[nodiscard]] DynArray<T> init_to_DynArray(std::initializer_list<T> il)
884{
886 for (const auto & item : il)
887 ret.append(item);
888 return ret;
889}
890
907template <class T>
908[[nodiscard]] DynDlist<T> init_to_DynDlist(std::initializer_list<T> il)
909{
911 for (const auto & item : il)
912 ret.append(item);
913 return ret;
914}
915
916// ==================== DynSetTree Conversions ====================
917
931template <typename Key, template <typename, class> class Tree, class Compare>
933{
935 s.for_each([&ret](const Key & item) { ret.append(item); });
936 return ret;
937}
938
952template <typename Key, template <typename, class> class Tree, class Compare>
954{
956 ret.reserve(s.size());
957 s.for_each([&ret](const Key & item) { ret.append(item); });
958 return ret;
959}
960
974template <typename Key, template <typename, class> class Tree, class Compare>
976{
978 s.for_each([&ret](const Key & item) { ret.append(item); });
979 return ret;
980}
981
992template <typename Key, template <typename, class> class Tree, class Compare>
994{
995 std::vector<Key> ret;
996 ret.reserve(s.size());
997 s.for_each([&ret](const Key & item) { ret.push_back(item); });
998 return ret;
999}
1000
1011template <typename Key, template <typename, class> class Tree, class Compare>
1013{
1014 std::set<Key> ret;
1015 s.for_each([&ret](const Key & item) { ret.insert(item); });
1016 return ret;
1017}
1018
1030template <class C>
1032{
1034 for (auto it = c.get_it(); it.has_curr(); it.next_ne())
1035 ret.insert(it.get_curr());
1036 return ret;
1037}
1038
1047template <class T>
1048[[nodiscard]] DynSetTree<T> vector_to_DynSetTree(const std::vector<T> & v)
1049{
1051 for (const auto & item : v)
1052 ret.insert(item);
1053 return ret;
1054}
1055
1056// ==================== DynSetHash Conversions ====================
1057
1068template <typename Key, template <typename, class> class HashTable, class Cmp>
1070{
1072 s.for_each([&ret](const Key & item) { ret.append(item); });
1073 return ret;
1074}
1075
1086template <typename Key, template <typename, class> class HashTable, class Cmp>
1088{
1090 ret.reserve(s.size());
1091 s.for_each([&ret](const Key & item) { ret.append(item); });
1092 return ret;
1093}
1094
1105template <typename Key, template <typename, class> class HashTable, class Cmp>
1107{
1109 s.for_each([&ret](const Key & item) { ret.append(item); });
1110 return ret;
1111}
1112
1123template <typename Key, template <typename, class> class HashTable, class Cmp>
1125{
1126 std::vector<Key> ret;
1127 ret.reserve(s.size());
1128 s.for_each([&ret](const Key & item) { ret.push_back(item); });
1129 return ret;
1130}
1131
1132// ==================== DynMapTree Conversions ====================
1133
1148template <typename Key, typename Data,
1149 template <typename, class> class Tree, class Compare>
1152{
1154 m.for_each([&ret](const std::pair<Key, Data> & p) { ret.append(p); });
1155 return ret;
1156}
1157
1169template <typename Key, typename Data,
1170 template <typename, class> class Tree, class Compare>
1173{
1175 ret.reserve(m.size());
1176 m.for_each([&ret](const std::pair<Key, Data> & p) { ret.append(p); });
1177 return ret;
1178}
1179
1191template <typename Key, typename Data,
1192 template <typename, class> class Tree, class Compare>
1193[[nodiscard]] std::map<Key, Data>
1195{
1196 std::map<Key, Data> ret;
1197 m.for_each([&ret](const std::pair<Key, Data> & p) {
1198 ret.emplace(p.first, p.second);
1199 });
1200 return ret;
1201}
1202
1214template <typename Key, typename Data,
1215 template <typename, class> class Tree, class Compare>
1218{
1220 m.for_each([&ret](const std::pair<Key, Data> & p) { ret.append(p.first); });
1221 return ret;
1222}
1223
1235template <typename Key, typename Data,
1236 template <typename, class> class Tree, class Compare>
1239{
1241 m.for_each([&ret](const std::pair<Key, Data> & p) { ret.append(p.second); });
1242 return ret;
1243}
1244
1256template <class K, class V, class Compare, class Alloc>
1258stdmap_to_DynMapTree(const std::map<K, V, Compare, Alloc> & m)
1259{
1261 for (const auto & [key, value] : m)
1262 ret.insert(key, value);
1263 return ret;
1264}
1265
1266// ==================== MapOpenHash Conversions ====================
1267
1279template <typename Key, typename Data, class Cmp,
1280 template <typename, class> class HashTable>
1283{
1285 m.for_each([&ret](const std::pair<Key, Data> & p) { ret.append(p); });
1286 return ret;
1287}
1288
1300template <typename Key, typename Data, class Cmp,
1301 template <typename, class> class HashTable>
1304{
1306 ret.reserve(m.size());
1307 m.for_each([&ret](const std::pair<Key, Data> & p) { ret.append(p); });
1308 return ret;
1309}
1310
1322template <typename Key, typename Data, class Cmp,
1323 template <typename, class> class HashTable>
1324[[nodiscard]] std::map<Key, Data>
1326{
1327 std::map<Key, Data> ret;
1328 m.for_each([&ret](const std::pair<Key, Data> & p) {
1329 ret.emplace(p.first, p.second);
1330 });
1331 return ret;
1332}
1333
1345template <typename Key, typename Data, class Cmp,
1346 template <typename, class> class HashTable>
1349{
1351 m.for_each([&ret](const std::pair<Key, Data> & p) { ret.append(p.first); });
1352 return ret;
1353}
1354
1366template <typename Key, typename Data, class Cmp,
1367 template <typename, class> class HashTable>
1370{
1372 m.for_each([&ret](const std::pair<Key, Data> & p) { ret.append(p.second); });
1373 return ret;
1374}
1375
1376} // end namespace Aleph
1377
1378#endif // AH_CONVERT_H
Simple dynamic array with automatic resizing and functional operations.
Definition tpl_array.H:138
constexpr size_t size() const noexcept
Return the number of elements stored in the stack.
Definition tpl_array.H:333
size_t size() const noexcept
Return the current dimension of array.
Dynamic doubly linked list with O(1) size and bidirectional access.
Self-adjusting dynamic hash table.
Dynamic singly linked list with functional programming support.
Definition htlist.H:1423
T & insert(const T &item)
Insert a new item by copy.
Definition htlist.H:1502
T & append(const T &item)
Append a new item by copy.
Definition htlist.H:1562
Generic key-value map implemented on top of a binary search tree.
Dynamic set backed by balanced binary search trees with automatic memory management.
const size_t & size() const
Returns the cardinality of the set.
void emplace(Args &&... args)
Appends a new element into the container by constructing it in-place with the given args.
Definition ah-dry.H:582
void for_each(Operation &operation)
Traverse all the container and performs an operation on each element.
Definition ah-dry.H:685
auto get_it() const
Return a properly initialized iterator positioned at the first item on the container.
Definition ah-dry.H:190
Main namespace for Aleph-w library functions.
Definition ah-arena.H:89
DynSetTree< T > vector_to_DynSetTree(const std::vector< T > &v)
Convert a std::vector to a DynSetTree.
std::set< Key > settree_to_stdset(const DynSetTree< Key, Tree, Compare > &s)
Convert a DynSetTree to a std::set.
DynList< T > to_DynList(const Array< T > &a)
Convert an Array to a DynList.
Definition ah-convert.H:147
DynList< K > map_keys_to_DynList(const std::map< K, V, Compare, Alloc > &m)
Extract keys from a std::map to a DynList.
Definition ah-convert.H:783
DynList< V > map_values_to_DynList(const std::map< K, V, Compare, Alloc > &m)
Extract values from a std::map to a DynList.
Definition ah-convert.H:806
DynList< std::pair< K, V > > map_to_DynList(const std::map< K, V, Compare, Alloc > &m)
Convert a std::map to a DynList of pairs.
Definition ah-convert.H:735
DynList< T > dyndlist_to_DynList(const DynDlist< T > &l)
Convert a DynDlist to a DynList.
Definition ah-convert.H:457
DynList< T > dynarray_to_DynList(const DynArray< T > &a)
Convert a DynArray to a DynList.
Definition ah-convert.H:187
DynList< Key > maptree_keys_to_DynList(const DynMapTree< Key, Data, Tree, Compare > &m)
Extract keys from a DynMapTree to a DynList.
DynArray< T > dyndlist_to_DynArray(const DynDlist< T > &l)
Convert a DynDlist to a DynArray.
Definition ah-convert.H:495
Array< std::pair< Key, Data > > maphash_to_Array(const MapOpenHash< Key, Data, Cmp, HashTable > &m)
Convert a MapOpenHash to an Array of pairs.
DynList< std::pair< Key, Data > > maphash_to_DynList(const MapOpenHash< Key, Data, Cmp, HashTable > &m)
Convert a MapOpenHash to a DynList of pairs.
Array< std::pair< Key, Data > > maptree_to_Array(const DynMapTree< Key, Data, Tree, Compare > &m)
Convert a DynMapTree to an Array of pairs.
DynDlist< T > vector_to_DynDlist(const std::vector< T > &v)
Convert a std::vector to a DynDlist.
Definition ah-convert.H:534
Array< T > deque_to_Array(const std::deque< T > &d)
Convert a std::deque to an Array.
Definition ah-convert.H:414
Array< T > init_to_Array(std::initializer_list< T > il)
Convert an initializer_list to an Array.
Definition ah-convert.H:858
std::vector< Key > sethash_to_vector(const DynHashTable< Key, HashTable, Cmp > &s)
Convert a DynHashTable (hash set) to a std::vector.
DynList< std::pair< Key, Data > > maptree_to_DynList(const DynMapTree< Key, Data, Tree, Compare > &m)
Convert a DynMapTree to a DynList of pairs.
std::decay_t< typename HeadC::Item_Type > T
Definition ah-zip.H:107
Array< T > dynarray_to_Array(const DynArray< T > &a)
Convert a DynArray to an Array.
Definition ah-convert.H:353
DynList< Data > maptree_values_to_DynList(const DynMapTree< Key, Data, Tree, Compare > &m)
Extract values from a DynMapTree to a DynList.
DynArray< Key > settree_to_DynArray(const DynSetTree< Key, Tree, Compare > &s)
Convert a DynSetTree to a DynArray.
Definition ah-convert.H:975
std::map< Key, Data > maphash_to_stdmap(const MapOpenHash< Key, Data, Cmp, HashTable > &m)
Convert a MapOpenHash to a std::map.
Array< T > set_to_Array(const std::set< T, Compare, Alloc > &s)
Convert a std::set to an Array.
Definition ah-convert.H:666
DynList< T > vector_to_DynList(const std::vector< T > &v)
Convert a std::vector to a DynList.
Definition ah-convert.H:250
DynArray< T > dynlist_to_DynArray(const DynList< T > &l)
Convert a DynList to a DynArray.
Definition ah-convert.H:207
DynArray< T > array_to_DynArray(const Array< T > &a)
Convert an Array to a DynArray.
Definition ah-convert.H:333
DynSetTree< typename C::Item_Type > to_DynSetTree(const C &c)
Convert a container to a DynSetTree (AVL by default).
@ Tree
Basic arc (in spanning tree).
DynArray< T > deque_to_DynArray(const std::deque< T > &d)
Convert a std::deque to a DynArray.
Definition ah-convert.H:435
std::vector< Key > settree_to_vector(const DynSetTree< Key, Tree, Compare > &s)
Convert a DynSetTree to a std::vector.
Definition ah-convert.H:993
std::set< typename C::Item_Type > to_set(const C &c)
Convert a container to a std::set.
Definition ah-convert.H:709
Array< T > vector_to_Array(const std::vector< T > &v)
Convert a std::vector to an Array.
Definition ah-convert.H:270
DynList< Key > sethash_to_DynList(const DynHashTable< Key, HashTable, Cmp > &s)
Convert a DynHashTable (hash set) to a DynList.
Array< typename C::Item_Type > to_Array(const C &c)
Convert a container to an Array.
Definition ah-convert.H:167
DynDlist< T > dynlist_to_DynDlist(const DynList< T > &l)
Convert a DynList to a DynDlist.
Definition ah-convert.H:476
Array< Key > sethash_to_Array(const DynHashTable< Key, HashTable, Cmp > &s)
Convert a DynHashTable (hash set) to an Array.
DynDlist< T > init_to_DynDlist(std::initializer_list< T > il)
Convert an initializer_list to a DynDlist.
Definition ah-convert.H:908
DynList< Data > maphash_values_to_DynList(const MapOpenHash< Key, Data, Cmp, HashTable > &m)
Extract values from a MapOpenHash to a DynList.
DynList< Key > settree_to_DynList(const DynSetTree< Key, Tree, Compare > &s)
Convert a DynSetTree to a DynList.
Definition ah-convert.H:932
std::map< Key, Data > maptree_to_stdmap(const DynMapTree< Key, Data, Tree, Compare > &m)
Convert a DynMapTree to a std::map.
DynArray< T > vector_to_DynArray(const std::vector< T > &v)
Convert a std::vector to a DynArray.
Definition ah-convert.H:291
DynList< T > deque_to_DynList(const std::deque< T > &d)
Convert a std::deque to a DynList.
Definition ah-convert.H:394
Array< std::pair< K, V > > map_to_Array(const std::map< K, V, Compare, Alloc > &m)
Convert a std::map to an Array of pairs.
Definition ah-convert.H:759
DynList< Key > maphash_keys_to_DynList(const MapOpenHash< Key, Data, Cmp, HashTable > &m)
Extract keys from a MapOpenHash to a DynList.
DynList< T > set_to_DynList(const std::set< T, Compare, Alloc > &s)
Convert a std::set to a DynList.
Definition ah-convert.H:644
DynMapTree< K, V > stdmap_to_DynMapTree(const std::map< K, V, Compare, Alloc > &m)
Convert a std::map to a DynMapTree.
DynArray< T > set_to_DynArray(const std::set< T, Compare, Alloc > &s)
Convert a std::set to a DynArray.
Definition ah-convert.H:689
Array< Key > settree_to_Array(const DynSetTree< Key, Tree, Compare > &s)
Convert a DynSetTree to an Array.
Definition ah-convert.H:953
std::vector< typename C::Item_Type > to_vector(const C &c)
Convert a container to a std::vector.
Definition ah-convert.H:228
DynArray< Key > sethash_to_DynArray(const DynHashTable< Key, HashTable, Cmp > &s)
Convert a DynHashTable (hash set) to a DynArray.
std::deque< typename C::Item_Type > to_deque(const C &c)
Convert a container to a std::deque.
Definition ah-convert.H:374
DynArray< typename C::Item_Type > to_DynArray(const C &c)
Convert a container to a DynArray.
Definition ah-convert.H:313
DynList< T > maps(const C &c, Op op)
Classic map operation.
DynDlist< T > dynarray_to_DynDlist(const DynArray< T > &a)
Convert a DynArray to a DynDlist.
Definition ah-convert.H:514
DynList< T > init_to_DynList(std::initializer_list< T > il)
Convert an initializer_list to a DynList.
Definition ah-convert.H:833
DynArray< T > init_to_DynArray(std::initializer_list< T > il)
Convert an initializer_list to a DynArray.
Definition ah-convert.H:883
Open addressing hash map for key-value pairs.
Dynamic array container with automatic resizing.
Lazy and scalable dynamic array implementation.
Dynamic doubly linked list implementation.
Dynamic map with open hashing.
Dynamic key-value map based on balanced binary search trees.
Dynamic set implementations based on hash tables.
Dynamic set implementations based on balanced binary search trees.
DynList< int > l