Any data structure supporting log(n) update, delete and index query?

Revision en1, by xblwyc, 2016-04-03 18:24:24

Suppose we are going to insert n numbers(may have duplicates), how would you design a data structure that supports the following functions in O(log n) time. int insert(int val) // return the index(how many numbers that are smaller than val) of the val int find(int k) // return the kth minimal value. int delete(int val) // delete the value

For offline algorithm(We can know all the values before), using binary index tree will be enough. But without that, how can we implement it?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English xblwyc 2016-04-03 18:28:59 45
en2 English xblwyc 2016-04-03 18:25:37 13
en1 English xblwyc 2016-04-03 18:24:24 555 Initial revision (published)