Any data structure supporting log(n) update, delete and index query?
Разница между en1 и en2, 13 символ(ов) изменены
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?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский xblwyc 2016-04-03 18:28:59 45
en2 Английский xblwyc 2016-04-03 18:25:37 13
en1 Английский xblwyc 2016-04-03 18:24:24 555 Initial revision (published)