Skip to content

This repository contains Java implementations of Radix Sort for both Integer and String inputs. It is part of the CPT212W Design and Analysis of Algorithms assignment at USM. The project features dynamic pass calculation, input validation, complexity analysis, and performance benchmarking.

Notifications You must be signed in to change notification settings

faiq-04/RadixSort-Integer-String

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CPT212 - Radix Sort: Integer and String Analysis

This repository contains the implementation and complexity analysis of Radix Sort for both integers and strings, as part of the CPT212 Design and Analysis of Algorithms assignment.

πŸ“ Project Overview

The project explores Radix Sort, a non-comparative sorting algorithm that sorts elements digit by digit. Two implementations are provided:

  • Integer Sort: Sorts positive integers.
  • String Sort: Sorts lowercase alphabetical words.

A complexity analysis was performed by measuring the number of primitive operations against increasing input sizes (5, 7, 10, and 20) to experimentally determine the time complexity.

βš™οΈ How to Run

The sorting algorithms are written in Java.

  1. Navigate to the src directory.
  2. Compile the Java files:
    javac IntegerSort.java
    javac StringSort.java
  3. Run the programs:
    java IntegerSort
    java StringSort

πŸ“Š Complexity Analysis Results

The analysis confirms that Radix Sort has a time complexity of $O(n \cdot k)$, where n is the number of elements and k is the number of digits (for integers) or the length of the longest string.

The String Sort algorithm shows a steeper growth in operations compared to Integer Sort, as k (string length) can grow more significantly than the number of digits in an integer.

About

This repository contains Java implementations of Radix Sort for both Integer and String inputs. It is part of the CPT212W Design and Analysis of Algorithms assignment at USM. The project features dynamic pass calculation, input validation, complexity analysis, and performance benchmarking.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published