I am looking for a data structure that supports the following operations for integer keys kfrom 0 to M-1.
k
insert(k)
erase(k)
lookup(k)
find_missing_key()
The obvious implementation will be the "list of free keys" structure, implemented as a heap; but it will occupy the space O (M). Is there some kind of data structure that meets all the requirements?
.
node [a, b] [a, a], , [a, m] [m + 1, b], m (a + b)/2.
, , root node [0, M-1] ( [0, M), )
node / , .
, x - O (log n): , [x, x] node .
find_missing_key O (log n): , node, , .
(EDIT: , , i_th - .)
Source: https://habr.com/ru/post/1627721/More articles:I want to generate a compilation warning for JPA annotations with a given value - javaКомандный пульт Teamcity Nunit 3.0 не работает - c#null values on $ _post - phpXcode build error with Unity 3D and Google Map for iOS - iosДолжен ли я публиковать свое приложение в той же учетной записи Google, что и в Google Play Services? - androidHow is order guaranteed during outages at Kafka Async Producer? - apache-kafkahttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1627723/r-ggplot2-change-x-axis-values-to-non-log-values&usg=ALkJrhiq_qglVUtE0uos0sRiLHcoCdMp5gDo you need to test the same methods as the methods that mocked Mockito? - javaWhat is the "Dirty" in React.js? - javascripthttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1627726/passing-arguments-to-superclass-constructor-without-repeating-them-in-childclass-constructor&usg=ALkJrhhPW2SdI4nLTM2yWnY-57uvOf4MmAAll Articles