Do we use hash tables in practice?

I just read about Hash tables and I wonder if we will use it in practice, because if I write a program that stores data in a Hash table, the storage will only be temporary. So, why not use a database to store it?

In other words, what real-world programs use hash tables to function?

+3
source share
3 answers

You must use hash tables to store data while you work. Using a database for this in many cases will be several orders of magnitude slower than using hash tables in memory. See for example:

- , .

Uses Hash table :

+6

, - , . .

+1
<x> the hash table is designed for quick access, say that you need to look for a lot of records, which will be very expensive. Using a hash function will lead you to almost the part that you want to execute. And you can implement a hash table of the database schema, so they are not necessarily temporary storage.
0
source

Source: https://habr.com/ru/post/1779766/


All Articles