Skip to content

Latest commit

 

History

History
111 lines (69 loc) · 2.24 KB

File metadata and controls

111 lines (69 loc) · 2.24 KB

Data Structures & Algorithms in Python

This repository contains implementations of core data structures and algorithms in Python, focusing on clarity, extensibility, and practical use cases.

🚀 Overview

The project covers three main areas:

  • Self-balancing binary trees (AVL)
  • Graph algorithms (BFS, DFS, shortest path)
  • Sorting algorithms with custom comparators

The goal is to demonstrate a solid understanding of algorithmic foundations and how they can be applied to real-world scenarios.


🌳 Trees: AVL & Binary Search Tree

File: trees_avl_bst.py

Features:

  • Binary Search Tree (BST) implementation
  • Self-balancing AVL tree using rotations
  • TreeMap abstraction (dictionary-like interface)
  • Insert, delete, search operations
  • Tree balancing and validation utilities
  • Tree traversal and visualization

Key concepts:

  • Height balancing
  • Rotations (left, right, double)
  • Time complexity optimization (O(log n))

🌐 Graph Algorithms

File: graphs_algorithms.py

Features:

  • Graph representation (adjacency list)
  • Breadth-First Search (BFS)
  • Depth-First Search (DFS) with cycle detection
  • Shortest path using priority queue (Dijkstra-like approach)

Key concepts:

  • Graph traversal
  • Pathfinding
  • Cycle detection
  • Weighted vs unweighted graphs

🔄 Sorting Algorithms

File: sorting_algorithms.py

Features:

  • Merge Sort
  • Quick Sort
  • Insertion Sort
  • Bubble Sort
  • Custom comparator support for sorting complex objects

Example use case:

Sorting custom objects (e.g. notebooks) by different attributes like likes or title.

Key concepts:

  • Divide and conquer
  • In-place vs non in-place sorting
  • Algorithmic complexity
  • Comparator-based design

🧪 Testing

Each module includes inline test cases demonstrating functionality and expected behavior.


🎯 Purpose

This project is part of a continuous effort to strengthen algorithmic thinking and build a solid technical foundation for data and software engineering roles.


🛠️ Tech Stack

  • Python 3
  • Standard Library (heapq, etc.)

📌 Future Improvements

  • Unit testing with pytest
  • Performance benchmarking
  • Visualization tools for trees and graphs
  • API-style interface for reuse in other projects

Manuel González