题目
单项选择题
R_sort_2 What is the worst-case time complexity of the Radix Sort algorithm for an array of n elements, where the maximum number of digits in any number is d?
选项
A.O(n log n)
B.O(n²)
C.O(n + d)
D.O(d * n)
查看解析
标准答案
Please login to view
思路分析
First, let's consider what Radix Sort does: it processes the input elements digit by digit, performing a stable sort (typically counting sort) for each digit position. Each pass over the n elements costs proportional to n, plus a small constant depending on the digit base.
Option 1: O(n log n). This re......Login to view full explanation登录即可查看完整答案
我们收录了全球超50000道考试原题与详细解析,现在登录,立即获得答案。
类似问题
zyBooks_18 Below is Radix Sort and its helper functions. What will RadixGetLength(17) evaluate to?
zyBooks_18 Assume radix sort has sorted integers by absolute value to produce the array (-12, 23, -42, 73, -78), and is about to build the negative and non-negative buckets to complete the sort. What integers will be placed into the negative bucket?
Consider the array: "one" "ring" "to" "bring" "them" "all" "and" "in" "the" "darkness" "bind" "them" If these items are sorted into descending order by the LSD Radix Sort algoirthm, which of the following is the resulting sequence? Sequence A: "to" "them" "them" "the" "ring" "one" "in" "darkness" "bring" "bind" "and" "all" Sequence B: "all" "and" "bind" "bring" "darkness" "in" "one" "ring" "the" "them" "them" "to" Sequence C: "in" "to" "all" "and" "one" "bind" "ring" "the" "them" "them" "bring" "darkness" Sequence D: "darkness" "bring" "them" "them" "ring" "bind" "the" "one" "and" "all" "to" "in"
Consider the array: "one" "ring" "to" "bring" "them" "all" "and" "in" "the" "darkness" "bind" "them" If these items are sorted into ascending order by the MSD Radix Sort algoirthm, which of the following is the resulting sequence? Sequence A: "to" "them" "them" "the" "ring" "one" "in" "darkness" "bring" "bind" "and" "all" Sequence B: "all" "and" "bind" "bring" "darkness" "in" "one" "ring" "the" "them" "them" "to" Sequence C: "in" "to" "all" "and" "one" "bind" "ring" "the" "them" "them" "bring" "darkness" Sequence D: "darkness" "bring" "them" "them" "the" "ring" "bind" "one" "and" "all" "to" "in"
更多留学生实用工具
希望你的学习变得更简单
加入我们,立即解锁 海量真题 与 独家解析,让复习快人一步!