Skip to content

Feuermelda/sorting-algorithms

Repository files navigation

Sorting Algorithms in Python

This repository contains my implementations of basic sorting algorithms as part of my self-guided programming journey. Each file represents one algorithm, written from scratch in Python.

Algorithms Implemented

  • Bubble Sort
    A basic comparison-based algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if needed.

  • Insertion Sort
    Builds the final sorted list one item at a time by inserting each new element into its correct position in the sorted part.

  • Bogo Sort
    A chaotic and inefficient sort that randomly shuffles the list until it happens to be sorted. Implemented for fun and learning purposes only.

  • Merge Sort
    Recursively splits the list into halves, sorts each half, and merges them back together in sorted order.

  • Selection Sort
    A simple comparison-based algorithm that repeatedly selects the smallest element from the unsorted part of the list and swaps it into its correct position.

  • Lexicographic Permuation Sort
    A permutation-based sort that shuffles through parallel realities (via itertools.permutations) until the sorted one is observed.

How to Use

To run an algorithm, use for example:

python bubble_sort.py

Or open and modify the list directly in the file. Each script runs independently.

Performance

Time all algorithms and see which one is the fastest (coming soon)

About

Basic sorting algorithms implemented in Python as part of my self-guided learning journey.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages