JavaSE22–HashMap

Collection framework_HashMap 1. Overview HashMap is a collection used to store Key-Value key-value pairs. (1) HashMap stores data according to the hashCode value of the key. In most cases, its value can be directly located, so it has fast access speed, but the traversal order is uncertain. (2) In HashMap, only one record with a […]

Hash mode and History mode

13.1 The difference between Hash mode and History mode In front-end routing, no matter what the implementation mode is, it is an implementation method of the client. That is, when the path changes, no request will be sent to the server. If you need to send a request to the server, you need to use […]

canvas uses front-end technology to generate image similarity hash (crop the image as long as the surrounding blank area is removed from the image content)

We made such a requirement in the front-end time. The designer designed the theme template through Photoshop software, and then we parsed the layer information in the psd file through the program, such as decorative pictures, text boxes, picture boxes, background pictures, etc. (this may be Some layer tags will be involved). For information on […]

In-depth discussion of hashCode method in java

Overview Students who have studied Java should all know that when rewriting the equals method, we have to rewrite the hashCode method, so why do we do this and what is the significance of doing so? The author will write an article here Let’s have an in-depth discussion with you based on “Effective Java”. The […]

[ABC310G] Takahashi And Pass-The-Ball Game

Problem Statement There are $N$ Takahashi. The $i$-th Takahashi has an integer $A_i$ and $B_i$ balls. An integer $x$ between $1$ and $K$, inclusive, will be chosen uniformly at random, and they will repeat the following operation $x$ times. For every $i$, the $i$-th Takahashi gives all his balls to the $A_i$-th Takahashi. Beware that […]

python hashlib module and examples

hashlib module Password encryption Password stuffing Password salting 1, hashlib module The hashlib module is a module used to encrypt strings. Through this function, the user’s password can be encrypted. Through the hash algorithm in the module, a string of any length can be encrypted into a string of hash values of the same length. […]

[[Hash Application] Bitmap/Bloom Filter]

Bitmap/Bloom filter bitmap bitmap concept Use of bitmaps Bitmap simulation implementation bloom filter Bloom filter concept Use of bloom filter Bloom filter simulation implementation Bitmap/Bloom Filter Application: Massive Data Processing Hash splitting Bitmap Bitmap concept Computers usually use bits as the smallest storage unit of data. There are only two binary states: 0 and 1. […]

Java SeriesHashSet

HashSet introduce Add element Determine whether the element exists Delete element To delete all elements in the collection, use the clear method: Calculate size Iterate over a HashSet Series of articles version record Introduction HashSet is implemented based on HashMap and is a set that does not allow duplicate elements. HashSet allows null values. HashSet […]

The deduplication principle of HashSet

The set collection has no index value and cannot be repeated. The bottom layer is map. When adding an element, the hashCode() method will be called first to calculate the hash value of the object, and then use the hash value % of the array length to calculate the index value position of the new […]