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?单项选择题
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
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
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
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
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道真实原题与详细解析,现在登录,立即获得答案。
更多留学生实用工具
希望你的学习变得更简单
加入我们,立即解锁 海量真题 与 独家解析,让复习快人一步!