/* #pragma once #include "EHS.h" #include namespace lwe { template class HashNode { private: V value; HashNode child; public: HashNode() { } HashNode(const V value) : value(value) { } HashNode(const HashNode& node) : value(node.value), child(node.child) { } HashNode& operator==(const HashNode& node) { value = node.value; child = node.child; return *this; } void SetValue(const V value) { this->value = value; } V GetValue() const { return value; } void SetChild(const HashNode child) { this->child = child; } HashNode* GetChild() { return &child; } }; /// 1000 template class HashMap { private: HashNode** data; N size; public: ~HashMap() { if (data) { delete[] data; data = nullptr; size = 0; } } HashMap() : data(nullptr), size(0) { } HashMap(const N size) : data(new HashNode(size)), size(size) { } HashMap(const HashMap& map) : data(new HashNode*(map.size)), size(map.size) { for (N i = 0; i < map.size; ++i) data[i] = map.data[i]; } HashMap& operator=(const HashMap& map) { if (this == &map) return *this; data = new HashNode*(map.size); size = map.size; for (N i = 0; i < size; ++i) data[i] = map.data[i]; return *this; } template void Insert(const K key, const V value) { } template<> void Insert(const Str_8& key, const V value) { N hash = 0; for (N i = 0; i < key.Size(); ++i) hash += key[i]; hash %= size; if (data[hash]) { HashNode child = data[hash]->GetChild(); if (child) } else { data[hash] = new HashNode(value); } } private: SetChildRecursive() { } }; } */