I need to implement a data structure that supports insertion deletion and search in O(log(n)) and extracting a special object in O(1). My Data structure needs to hold vehicles sorted by their ID and every vehicle has a field which represents the time until the next service. I need to extract the vehicles that needed to be services next in O(1). All suggestions are welcome.
我的理解是,我需要两个单独的数据结构,我想有1个系统和1个优先事项。 以其他参数分类,但持有同一点的复印件。 我面临的问题是,当我试图从“定点”结构中删除时,我仍把垃圾放在其他数据结构上(优先位置)。