Which sorting algorithms is most efficient to sort string consisting of ASCII characters?
(A) Quick sort
(B) Heap sort
(C) Merge sort
(D) Counting sort
Answer: (D)
Explanation: Counting sort algorithm is efficient when range of data to be sorted is fixed. In the above question, the range is from 0 to 255(ASCII range). Counting sort uses an extra constant space proportional to range of data.
Quiz of this Question

… [Trackback]
[…] Here you can find 16396 additional Info on that Topic: geeksforgeeks.org/algorithms-sorting-question-20/ […]
… [Trackback]
[…] There you will find 77755 additional Info to that Topic: geeksforgeeks.org/algorithms-sorting-question-20/ […]
… [Trackback]
[…] Read More on on that Topic: geeksforgeeks.org/algorithms-sorting-question-20/ […]