What are the advantages of splay tree over hash table?

Since splay trees are used for caching, I was wondering what are the advantages of Splay Tree over HashTable when I want to cache efficiently?

When should I prefer to drag a tree over a hash table?

I think this is a more specialized case than BST, there please do not mess with the answer of BST vs Hashtable.

+4
source share
1 answer

It really depends on what you mean by efficiency.

/, , . , , , .

, , ( ), splay , O (log n), - O (n).

, - , 3 1 . , , , .

, , Hash , O (1).

. , "" / " " , . , , -.

, , -, , .

:)

, , ! , Google, , ! !

+2

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


All Articles