Custom Interval map implementation

Revision en1, by 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.

Tags problem, map, interview, coding

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English peraltaJacob 2021-10-06 11:27:31 519 Initial revision (published)