Custom Interval map implementation

Правка en1, от peraltaJacob, 2021-10-06 11:27:31

I want to develop a custom Interval map something like this.
Initially all keys in the map will point to value k. Now we will insert ranges in the map let's suppose :- (1,4)-> 2 , (3,5)-> 6 Then we can access values via keys provided in the map. The main issue is we have to implement all of this in o(log(n)) complexity all for insertion, deletion, retrieval.

PS: Map's key type and value type can be anything(key can be decimal, integer string etc).Even ranges can be decimal.

Теги problem, map, interview, coding

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский peraltaJacob 2021-10-06 11:27:31 519 Initial revision (published)