Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e50168c

Browse files
Create Readme.md
1 parent c1d6751 commit e50168c

File tree

1 file changed

+11
-0
lines changed
  • Competitive Coding/Sorting/Radix_Sort

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Radix Sort The lower bound for Comparison based sorting algorithm (Merge Sort, Heap Sort, Quick-Sort .. etc) is Ω(nLogn), i.e., they cannot do better than nLogn.
2+
3+
Counting sort is a linear time sorting algorithm that sort in O(n+k) time when elements are in range from 1 to k.
4+
5+
What if the elements are in range from 1 to n2?
6+
7+
We can’t use counting sort because counting sort will take O(n2) which is worse than comparison based sorting algorithms. Can we sort such an array in linear time? Radix Sort is the answer. The idea of Radix Sort is to do digit by digit sort starting from least significant digit to most significant digit. Radix sort uses counting sort as a subroutine to sort.
8+
9+
The Radix Sort Algorithm
10+
11+
Do following for each digit i where i varies from least significant digit to the most significant digit. a) Sort input array using counting sort (or any stable sort) according to the i’th digit.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /