[Complete code of hash table] Simulate the implementation of hash table and unordered_set and unordered_map

Table of Contents HashTable.h: Test.cpp: MyUnorderedSet.h: HashTable.h: #pragma once #include<iostream> #include<vector> #include<utility>//pair header file #include<assert.h> #include<string> using namespace std; namespace CLOSEHASH { enum State { EMPTY, //empty EXIST, //exists DELETE //Delete }; template<class T> struct HashData { T_data; State _state; //Represents data status HashData() :_state(EMPTY) ,_data(0) {} }; template<class K, class T, class KeyOfT> classHashTable […]

IF: 16+ Studying the correlation between immunosuppressive tumor microenvironment and liver metastasis of pancreatic cancer based on scRNA-seq

The tutorials of Huanfeng Gene not only teach you how to use it, but also regularly analyze some related articles. Learning the tutorials is only the basis, but integrating the analysis results into the articles is the purpose. I think our tutorials are pretty good, and you can follow our If you get good results […]

B – Influence on Social media, factor decomposition, thinking, unordered_map

Influence on Social media – Problems – CodeChef Problem Recently social media has been flooded by fb posts, tweets, news articles about only thing – demonetization. A great debate is ongoing over it. Most of the people discussing in social media platform usually tend to take sides, i.e. either they support the move, or they […]

[C++] Hash – unordered series containers | Hash conflict | Closed hashing | Open hashing

Article directory 1. Unordered series of associative containers 2. Hash concept 3. Hash collision 4. Hash function 5. Resolve hash conflicts 1. Closed hashing – open addressing method 2. Code implementation 3. Open hashing – open chain method 4. Code implementation 6. Conclusion 1. Unordered series of associative containers In C++98, STL provides a series […]

Telecom ctyunos install docker-ce

This installation is the first time to use ctyunos, and it also needs to install docker in the intranet environment. This self-developed system currently lacks documentation. I have been struggling for a few days. I hope it can provide some ideas for colleagues who encounter similar problems. There is no guarantee. This record can solve […]

Encapsulation of unordered_map and unordered_set

In STL, the search of unordered_map and unordered_set is at the ceiling level. Their underlying logic is very simple, which is hash poke. The logic of hash poke is very simple, just different linked lists and arrays (in my opinion). But don’t insist on implementing unordered_map and unordered_set. It’s very simple. Just like cooking, each […]

Improvement of hash bucket + encapsulation into unordered set and map

Table of Contents Further implementation of hash buckets introduce keyofValue Iterator insert return value operator[ ] key cannot be modified Simulation implementation keyofValue code Iterator who is first Convert ordinary iterator to const iterator const *this problem code insert and erase Convert const iterator to normal iterator key cannot be modified Full version code unordered […]

[C++ unordered_set, unordered_map]

Directory 1. Hash 1.1 Hash–open hashing 1.2 Hash–Closed Hash 1.3 Hash optimization 2. unordered_set, unordered_map 2.1 Framework construction of unordered_set and unordered_map 2.2 Iterators of unordered_set and unordered_map 2.2.1 Construction of ordinary iterators 2.2.2 Encapsulation of ordinary iterators 2.2.3 Unordered_set encapsulation of ordinary iterators 2.2.4 Unordered_map encapsulation of ordinary iterators 2.3 The Keys of unordered_set […]

C++ – unordered series of associative containers and hashes

1. unordered series associative containers 2. Hash principle 3. Unordered_map simulation implementation 1. unordered series associative containers unordered_map is an associative container that stores key-value pairs. Their types can be different. Unlike map, unordered_map does not perform a specific sorting of key values. Its bottom layer uses hash, and the hash values are the same. […]

[unordered_map/unordered_set] is implemented by [Hash/Hash] simulation (hand-shredded iterator)

Article directory 1. Iterator analysis 2.Detail processing 3. Complete code 3.1HashTable.h 3.2unordered_set.h 3.3unordered_map.h 3.4Test.cpp 1. Iterator analysis 2.Detail processing The following two articles are the author’s painstaking efforts Those who want to understand this article uuPlease check it yourself Detailed implementation of hashing/hashing Hash/Hash – Hash Table [Ideas to Structure] [==revision==] Detailed processing of hand-shredded […]