Skip to content

NightSoma/data-structures-and-algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Structures and Algorithms - Python Implementations

This repository contains my implementations of various important data structures and algorithms in Python. These implementations were developed as part of my learning journey while taking the Algorithms course by ThePrimeagen on Frontend Masters.

Key Features

  • Comprehensive: Covers a wide range of fundamental data structures and algorithms (see Contents).
  • Well-Tested: 280 tests with 100% code coverage using pytest and pytest-cov.
  • Clean Code: Focus on readability and maintainability.
  • Modern Tooling: Uses uv for efficient dependency and virtual environment management.

Contents

This repository is organized into the following directories:

  • search: Search algorithms (binary search, linear search, 'crystal breaks' problem).
  • sort: Sorting algorithms (bubble sort, quicksort).
  • heap: Heap implementation.
  • stack: Stack implementation.
  • queue: Queue implementation.
  • ring_buffer: Ring buffer implementation.
  • recursion: Examples of recursion (maze solver).
  • singly_linked_list: Singly linked list implementation.
  • doubly_linked_list: Doubly linked list implementation.
  • tree_search: Tree search algorithms (BST, DFOperations on BinaryTree, traversal, compare).
  • tries: Trie implementation.
  • graphs: Graph algorithms (BFS, DFS, Dijkstra's).
  • lru: LRU (Least Recently Used) cache.

Requirements

  • Python 3.13 or higher.
  • uv

Setup and Usage

  1. Clone the repository:

    git clone https://github.com/NightSoma/data-structures-and-algorithms.git
    cd data_structures_and_algorithms
  2. Initialize project and create a virtual environment using uv:

    uv init --no-workspace
    uv venv
  3. Activate the virtual environment:

     source .venv/bin/activate  # On Linux/macOS
    .venv/Scripts/activate  # On Windows

    Note: gitbash on windows may not run .venv/Scripts/activate

  4. Install dependencies with uv:

    uv pip install ".[dev,test]"

Running Tests

To run all tests with coverage analysis:

pytest --cov=. --cov-report term-missing

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

My implementations of important data structures and algorithms

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages