Question
Consider the radix sort algorithm. (i) Explain how radix sort works, to what inputs it can be applied and what its asymptotic complexity is. [5
Consider the radix sort algorithm.
(i) Explain how radix sort works, to what inputs it can be applied and what its asymptotic complexity is. [5 marks]
(ii) Explain why running radix sort does not proceed from most to least significant digit, as would at first seem more intuitive. [4 marks]
(iii) Give a proof by induction of the correctness of radix sort. [4 marks]
(b) Clearly describe an algorithm, strictly better than O(n 2 ), that takes a positive integer s and a set A of n positive integers and returns a Boolean answer to the question whether there exist two distinct elements of A whose sum is exactly s. Evaluate its complexity. [7 marks]
Step by Step Solution
3.49 Rating (152 Votes )
There are 3 Steps involved in it
Step: 1
The detailed answer for the above question is provided below a i Radix sort is an efficient noncomparative integer sorting algorithm that sorts data with integer keys by grouping the keys by the indiv...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started