Skip to content
ExamHope Logo

examhope

Primary Menu
  • Digital Logic
    • Arithmetic Operations
    • Asynchronous/Ripple Counters
    • Basic Gates
    • Boolean Algebraic Theorems
    • Codes
  • Data Structures
    • Binary Heaps
    • Binary Search
    • Binary Search Trees
    • Binary Tree
    • Binary Tree Sort
    • Bipartite Graphs
    • Complete Graph
  • Theory of Computation
    • Finite Automata
    • Finite Automaton First Example
  • Current Affairs
    • Sports News
    • Tech News
    • Bollywood News
    • Daily News
  • Database
  • Computer Network
  • Computer Organization and Architecture
  • C Language
  • Operating Systems
  • Software Engineering
  • Theory of Computation
  • About us
  • Contact Us
  • Privacy Policy
  • DMCA Policy
  • Terms and Conditions
  • Home
  • IT
  • Data Structures
  • Radix Sort — Sorting
  • Radix Sort
  • Data Structures

Radix Sort — Sorting

examhopeinfo@gmail.com November 12, 2025 2 minutes read
Radix Sort

Radix Sort

🌱 What Is Radix Sort?

Radix Sort is a non-comparative sorting algorithm — meaning it doesn’t compare numbers directly.
Instead, it sorts numbers digit by digit, starting from either the least significant digit (LSD) or the most significant digit (MSD).

Think of it like sorting a list of phone numbers:
You could first arrange them by the last digit, then by the second-last, and so on — until the whole list is perfectly ordered.


🧩 How Radix Sort Works (Step-by-Step)

Let’s understand this with an example:
We’ll sort [170, 45, 75, 90, 802, 24, 2, 66] in ascending order using LSD (Least Significant Digit) method.


Step 1: Sort by the rightmost digit (units place)

We group numbers according to their last digit:

DigitNumbers
0170, 90
2802, 2
424
545, 75
666
8–
9–

After rearranging:
[170, 90, 802, 2, 24, 45, 75, 66]


Step 2: Sort by the next digit (tens place)

Now we look at the second digit from the right:

DigitNumbers
0802, 2
224
445
666
775
990
7170

After rearranging:
[802, 2, 24, 45, 66, 75, 90, 170]


Step 3: Sort by the leftmost digit (hundreds place)

Now we sort based on the hundreds digit:

DigitNumbers
02, 24, 45, 66, 75, 90
1170
8802

Final sorted list:
[2, 24, 45, 66, 75, 90, 170, 802]


📊 Diagram of Radix Sort

Initial List: [170, 45, 75, 90, 802, 24, 2, 66]

Pass 1 (On units digit):   [170, 90, 802, 2, 24, 45, 75, 66]
Pass 2 (On tens digit):    [802, 2, 24, 45, 66, 75, 90, 170]
Pass 3 (On hundreds digit):[2, 24, 45, 66, 75, 90, 170, 802]

Each pass brings the list closer to being fully sorted.


🧠 Why It Works

Radix Sort relies on stable sorting — meaning if two numbers have the same digit in the current position, their order stays the same as before.
That’s why we often use another algorithm like Counting Sort inside Radix Sort to handle each digit group efficiently.


💡 Real-Life Analogy

Imagine sorting a box of letters addressed to different cities.
You could first group them by the last letter of the city name,
then by the second last letter, and continue until they’re all neatly arranged.
That’s pretty much what Radix Sort does — but with digits!


⚙️ Time Complexity

  • Best case: O(nk)
  • Average case: O(nk)
  • Worst case: O(nk)

Here,

  • n = number of elements,
  • k = number of digits in the largest number.

Radix Sort is very efficient when k is small compared to n.


🧾 Advantages

✅ Works great for large numbers or fixed-length integers.
✅ No comparisons needed between elements.
✅ Stable sorting (keeps order of equal elements).


⚠️ Disadvantages

❌ Needs extra space for temporary buckets or queues.
❌ Not suitable for data with very large digit counts or decimals.


About the Author

examhopeinfo@gmail.com

Administrator

Visit Website View All Posts

Post navigation

Previous: Shell Sort — Sorting
Next: Binary Search — Searching

Related News

Linked Representation
  • Linked Representation of a Graph
  • Data Structures

Linked Representation of a Graph

examhopeinfo@gmail.com November 14, 2025 0
Path Matrix
  • Path Matrix
  • Data Structures

Path Matrix

examhopeinfo@gmail.com November 14, 2025 0
Adjacency Matrix
  • Adjacency Matrix
  • Data Structures

Adjacency Matrix

examhopeinfo@gmail.com November 14, 2025 0

Recent Posts

  • India Squad for Afghanistan Series Likely to Witness Major Changes, Leadership Reshuffle Possible
  • Brazil Unveils 26-Man Squad for 2026 FIFA World Cup Under Carlo Ancelotti
  • Ruturaj Gaikwad Highlights Squad Challenges After CSK’s Defeat Hurts IPL 2026 Playoff Hopes
  • MS Dhoni Misses CSK Clash Against SRH Due to Fitness Concerns, Ruturaj Gaikwad Shares Update
  • IPL 2026 Playoff Race Heats Up: Rajasthan Royals’ Defeat to Delhi Capitals Changes Top-4 Battle

At ExamHope, we understand that preparing for exams can be challenging, overwhelming, and sometimes stressful. That’s why we are dedicated to providing high-quality educational resources, tips, and guidance to help students and aspirants achieve their goals with confidence. Whether you are preparing for competitive exams, school tests, or professional certifications, ExamHope is here to make your learning journey smarter, easier, and more effective.

Quick links

  • About us
  • Contact Us
  • Privacy Policy
  • Terms and Conditions
  • Disclaimer
  • DMCA Policy

Category

  • Computer Network
  • Computer Organization and Architecture
  • Data Structures
  • C Language
  • Theory of Computation
  • Database

You may have missed

India Squad for Afghanistan Series
  • IT

India Squad for Afghanistan Series Likely to Witness Major Changes, Leadership Reshuffle Possible

examhopeinfo@gmail.com May 19, 2026 0
Brazil Football Team
  • IT
  • Current Affairs
  • Sports News

Brazil Unveils 26-Man Squad for 2026 FIFA World Cup Under Carlo Ancelotti

examhopeinfo@gmail.com May 19, 2026 0
CSK Vs SRH Ipl match
  • IT
  • Current Affairs
  • Sports News

Ruturaj Gaikwad Highlights Squad Challenges After CSK’s Defeat Hurts IPL 2026 Playoff Hopes

examhopeinfo@gmail.com May 19, 2026 0
MS Dhoni News
  • IT
  • Current Affairs
  • Sports News

MS Dhoni Misses CSK Clash Against SRH Due to Fitness Concerns, Ruturaj Gaikwad Shares Update

examhopeinfo@gmail.com May 18, 2026 0
Copyright © All rights reserved for ExamHope. | MoreNews by AF themes.
Go to mobile version