In order to sort list of numbers using radix sort algorithm, we need to get…

2017

In order to sort list of numbers using radix sort algorithm, we need to get the individual digits of each number ‘n’ of the list. If n is a positive decimal integer, then ith digit, from right, of the number n is:

Attempted by 139 students.

Show answer & explanation

The correct answer is Option A. To extract the i-th digit from the right of a decimal integer n, you drop the rightmost i-1 digits by performing integer division by 10i-1 (modeled by the floor function ....). Then, taking modulo 10 (%10) isolates the target unit digit.

Explore the full course: Coal India Management Trainee