Which of the following data structures is used to implement the priority queue's insert, getMax, and delMax interfaces to achieve O(lgn) time complexity?使用以下哪种数据结构实现优先级队列的insert, getMax, delMax接口均可达到O(lgn)的时间复杂度?
A: vector向量
B: ordered vector有序向量
C: Hash table散列表
D: Balanced binary search tree平衡二叉搜索树
A: vector向量
B: ordered vector有序向量
C: Hash table散列表
D: Balanced binary search tree平衡二叉搜索树
举一反三
- 使用以下哪种数据结构实现优先级队列的insert, getMax, delMax接口均可达到O(lgn)的时间复杂度? A: 向量 B: 有序向量 C: 散列表 D: 平衡二叉搜索树
- The time complexity of building a complete binary heap of size n by the Floyd build-heap algorithm is:Floyd建堆算法建立规模为n的完全二叉堆的时间复杂度为: A: O(nlgn) B: O(n) C: O(lgn) D: O(1)
- How to use the heap to sort:如何用堆来实现排序: A: Continue to call delMax() after building a heap建堆后不断调用delMax() B: Continue to call getMax() after building a heap建堆后不断调用getMax() C: Continue to call insert() after building a heap建堆后不断调用insert() D: Build the heap建堆
- How to use the heap to sort:如何用堆来实现排序:- 未答 A: Continue to call delMax() after building a heap建堆后不断调用delMax() B: Continue to call getMax() after building a heap建堆后不断调用getMax() C: Continue to call insert() after building a heap建堆后不断调用insert() D: Build the heap建堆
- (接上题)Easy implementation and O(lgn) complexity 需要易于实现,而且各接口的分摊复杂度为O(lgn) A: AVL trees AVL树 B: Splay trees 伸展树 C: B-trees B-树 D: Red-black trees E: kd-trres kd-树