Skip to content

pytchioma/Smart-sorting-system-Group-C

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SMART SORTING SYSTEM (Python)

A Smart Sorting System developed in Python that intelligently sorts data using advanced divide-and-conquer algorithms. This project demonstrates algorithmic efficiency, performance comparison, benchmarking analysis, and structured problem-solving through the implementation of Quick Sort (primary algorithm) and Merge Sort (alternate algorithm).


Project Overview

The Smart Sorting System goes beyond basic sorting. Instead of relying on Python’s built-in sorting functions, this system:

  • Implements custom sorting algorithms manually
  • Automatically benchmarks algorithm performance
  • Tracks execution time, comparisons, and memory usage
  • Generates a comparison report
  • Provides decision-making insights

The system functions as both a sorting tool and a performance analysis framework.


System Usage Flow

1️⃣ INPUT Phase

  • User feeds unsorted data into the system
  • Accepts numerical arrays (extendable to other data types)

2️⃣ SELECTION Phase

  • System executes both Quick Sort and Merge Sort
  • Enables performance comparison
  • Designed for intelligent algorithm evaluation

3️⃣ PROCESSING Phase

  • Algorithms apply divide-and-conquer strategy
  • Sorting operations are executed recursively

4️⃣ ANALYSIS Phase

Performance Analyzer tracks:

  • Time taken to sort
  • Number of comparisons performed
  • Memory consumption

5️⃣ OUTPUT Phase

System provides:

  • Sorted data array
  • Detailed comparison report
  • Efficiency metrics
  • Speed comparison

6️⃣ DECISION MAKING

Users can:

  • Identify the faster algorithm for the dataset
  • Understand trade-offs between algorithms
  • Optimize future applications

Core Features

  • Manual implementation of Quick Sort
  • Manual implementation of Merge Sort
  • Performance benchmarking system
  • Execution time measurement
  • Comparison counter
  • Memory usage tracking
  • Decision insight output
  • Clean, modular Python structure

Algorithms Implemented

🔹 Quick Sort (Primary Algorithm)

Quick Sort serves as the main sorting engine of the system.

Why Quick Sort?

  • Faster in real-world applications
  • Efficient for large datasets
  • Lower memory usage
  • Excellent average-case performance: O(n log n)

How Quick Sort Works:

  1. Selects a pivot element
  2. Partitions elements into smaller and larger groups
  3. Recursively sorts sub-arrays

🔹 Merge Sort (Alternate Algorithm)

Merge Sort is implemented to provide guaranteed performance comparison and stability analysis.

Why Merge Sort?

  • Guaranteed time complexity of O(n log n)
  • Stable sorting algorithm
  • Reliable for structured datasets

How Merge Sort Works:

  1. Divides the dataset into halves
  2. Recursively sorts each half
  3. Merges sorted halves into one sorted array

Algorithm Comparison

Feature Quick Sort Merge Sort
Strategy Divide & Conquer Divide & Conquer
Average Time O(n log n) O(n log n)
Worst Case O(n²) O(n log n)
Memory Usage Low Higher
Stability Not Stable Stable
Real-world Speed Very Fast Consistent

Why It Is Called a “Smart” Sorting System

This system is considered smart because:

  • It does not rely on built-in sorting functions
  • It benchmarks algorithm performance
  • It compares efficiency metrics
  • It provides performance analytics
  • It generates a decision-making report
  • It supports data-driven optimization

It combines sorting + benchmarking + analytical reporting into one integrated system.


How to Run the Project

1. Clone the Repository

bash git clone https://github.com/your-username/smart-sorting-system.git

2. Navigate to the Folder

cd smart-sorting-system

3. Run the Program

python smart_sorting_system.py


Example Usage

Enter numbers separated by commas: 45, 12, 78, 3, 19

SORTED OUTPUT

Sorted Data: [3, 12, 19, 45, 78]

PERFORMANCE REPORT

Quick Sort:

Time: 0.00012 seconds

Comparisons: 14

Memory Used: 184 bytes

Merge Sort:

Time: 0.00018 seconds

Comparisons: 17

Memory Used: 232 bytes

DECISION INSIGHT

Quick Sort was faster for this dataset.


Project Objectives:


  1. Implement divide-and-conquer algorithms manually

  2. Analyze algorithm performance

  3. Compare efficiency metrics

  4. Understand time and space complexity

  5. Develop benchmarking capabilities

  6. Demonstrate intelligent computational decision-making


Educational Value


This project strengthens understanding of:

  1. Algorithm design

  2. Recursion

  3. Time complexity analysis

  4. Space complexity considerations

  5. Performance measurement

  6. Software benchmarking principles


End Goal


The Smart Sorting System delivers:

✅ Sorted data (practical output)

✅ Performance insights (analytical output)

It serves as both a functional sorting solution and an algorithm benchmarking system.


Conclusion


The Smart Sorting System successfully integrates sorting functionality with performance analysis. Quick Sort is used as the primary algorithm due to its practical efficiency, while Merge Sort provides stability and guaranteed performance for comparative evaluation.

The project demonstrates structured software development, algorithmic thinking, and data-driven decision-making.

About

Smart sorting system

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%