Sorted arrays and binary search trees can both be used as a dictionary data structure. Suppose that a dictionary is required to store n items that will be inserted in a randomized order. Which statement is not correct?单项选择题

A

Insertion into a sorted array takes O(n) time in the worst case, and insertion into a binary search tree also takes O(n) time in the worst case

B

Search in a sorted array takes O(log n) time in the average case, and search in a binary search tree also takes O(log n) time in the average case

C

Search in a sorted array takes O(log n) time in the worst case, whereas search in a binary search tree takes O(n) time in the worst case

D

Insertion into an sorted array takes O(n) time in the average case, whereas insertion into a binary search tree takes O(log n) time in the average case

E

Search in a sorted array takes O(n) time in the worst case, and search in a binary search tree also takes O(n) time in the worst case

登录即可查看完整答案

我们收录了全球超50000道真实原题与详细解析,现在登录,立即获得答案。

更多留学生实用工具

加入我们,立即解锁 海量真题独家解析,让复习快人一步!