I need to implement a cache with regular cache operations, along with the ability to quickly retrieve the maximum element from the cache.
Can you suggest data structures to implement this?
I thought of using a hash map along with a list to keep the minimum element.
Suggest other approaches with better complexity.
heap is great for quickly restoring the maximum element.
, lookaside, . N (- 8 ), ( ) :
[list N] [list N*2] [list N*4] [list N*8] ...
. , (S), LOG2 (S/N) , , . ( ) , , , .
Source: https://habr.com/ru/post/1715249/More articles:Compare array in javascript - javascriptHow to get the process id of the calling process in erlang? - erlangjavascript comparison array - javascriptVisual Studio Debugging Path - cC stackoverflow runtime - cHow to add value of combobox element in string collection editor in c #? - c #VB6: expanding the number of items in a combo box - vb6CAShaperLayer -renderInContext not working? - iphonePerformance: compiling in VS, running in mono on Windows and Linux - performancetips for building my first e-commerce site - e-commerceAll Articles