7 template<class K, class V>
15 /** mindblowingly stupid Associative array implementation.Hungarian: map
17 template<class K, class V>
19 Array< Assoc_ent_<K,V> > arr;
23 int find(K key) const {
24 for (int i = 0; i < arr.size(); i++) {
25 if (!arr[i].free && key == arr[i].key)
30 int find_creat(K key) {
32 for (int i = 0; i < arr.size(); i++) {
33 if (key == arr[i].key) {
35 } else if (arr[i].free ) {
40 arr[free].free = false;
52 bool elt_query(K key) const {
53 return find(key) >= 0;
56 assert(elt_query(key));
62 int i = find_creat(key);
66 should create "set" template
68 V& operator[](K key) {
69 return arr[find_creat(key)].val;
71 const V& operator[](K key) const {
72 assert(elt_query(key));
73 return arr[find(key)].val;