Skip to content

ppant/DS-Algos-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

154 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“š Data Structures and Algorithms using Python

A comprehensive learning resource for implementing common data structures and algorithms in Python

Python Version License Contributions Welcome GitHub Stars


๐ŸŽฏ About This Repository

This repository was started in 2017 with a simple goal: to create a comprehensive, well-documented collection of Data Structures and Algorithms implementations in Python. Whether you're preparing for technical interviews, learning CS fundamentals, or just brushing up on your algo skills, this repo serves as a practical reference.

Why This Repository?

  • ๐Ÿ“– Educational: Each implementation is well-commented and easy to understand
  • ๐Ÿ”„ Multiple Solutions: Different approaches to the same problem (brute force, optimized, etc.)
  • ๐ŸŽ“ Interview Ready: Solutions for common technical interview questions
  • ๐Ÿš€ Practical: Standalone scripts that can be run and modified

๐Ÿค Contributing

This is an open-source learning project! We welcome contributions from everyone:

  • Found a bug? Open an issue
  • Have a better solution? Submit a pull request
  • Want to add new algorithms? Contributions are always appreciated!
  • Have learning notes? Share them with the community

๐Ÿ“– Table of Contents


๐Ÿš€ Getting Started

Prerequisites

  • Python 3.6 or higher
  • Basic understanding of Python syntax

Running Examples

Most scripts in this repository are standalone and can be executed directly:

# Run any Python script
python3 Arrays/Anagram_Check_Sorted_Sol.py

# Or run from the repo root
python3 Sorting/BubbleSortImple.py

๐Ÿ“ Project Structure

.
โ”œโ”€โ”€ Arrays/              # ๐Ÿ”ค Array-based problems and algorithms
โ”œโ”€โ”€ LinkedLists/         # ๐Ÿ”— Singly and Doubly Linked Lists
โ”œโ”€โ”€ Stacks/              # ๐Ÿ“š Stack implementations and applications
โ”œโ”€โ”€ Queues/              # ๐Ÿ“ฆ Queue implementations (FIFO)
โ”œโ”€โ”€ deque/               # ๐Ÿ”„ Double-ended queue
โ”œโ”€โ”€ Trees/               # ๐ŸŒณ Binary Trees, BSTs, Heaps, and Traversals
โ”œโ”€โ”€ Sorting/             # ๐Ÿ“Š Common sorting algorithms
โ”œโ”€โ”€ Recursion/           # ๐Ÿ”€ Recursive problems and Dynamic Programming
โ”œโ”€โ”€ GraphAlgorithms/     # ๐Ÿ—บ๏ธ Graph traversal (BFS, DFS) and pathfinding
โ”œโ”€โ”€ Error-debug/         # โš ๏ธ Error handling and debugging examples
โ””โ”€โ”€ README.md            # This file

๐Ÿ“Š Data Structures

Arrays ๐Ÿ”ค

Common array-based algorithms and manipulations.

Linked Lists ๐Ÿ”—

Implementations and problems involving linked structures.

Stacks ๐Ÿ“š

LIFO (Last-In-First-Out) data structures.

Queues ๐Ÿ“ฆ

FIFO (First-In-First-Out) data structures.

Deque ๐Ÿ”„

Double-ended queue operations.

Trees ๐ŸŒณ

Hierarchical data structures.


โšก Algorithms

Sorting ๐Ÿ“Š

Algorithms for arranging elements in order.

Recursion & Dynamic Programming ๐Ÿ”€

Solving problems by breaking them into smaller sub-problems.

Graph Algorithms ๐Ÿ—บ๏ธ

Algorithms for graph traversal and pathfinding.


๐Ÿ“– Usage

Most scripts in this repository are standalone. You can run them using the Python 3 interpreter:

python3 path/to/script.py

Example:

python3 Sorting/BubbleSortImple.py

๐Ÿ“Š Quick Reference

Topic Easy Medium Hard
Arrays Anagram Check Array Pair Sum Find Missing Element
Linked Lists Singly LL Cycle Detection Reverse LL
Trees Binary Search BST Validation Trim BST
Sorting Bubble Sort Merge Sort Quick Sort
DP Fibonacci Coin Change Word Split

๐ŸŽ“ Learning Path

New to DSA? Follow this recommended order:

  1. Start with Arrays - Fundamental data structure
  2. Learn Sorting - Essential for interviews
  3. Study Linked Lists - Understanding pointers/references
  4. Master Stacks & Queues - Core data structures
  5. Explore Trees - Most interview questions
  6. Dive into Recursion & DP - Advanced problem solving
  7. Finish with Graphs - Complex algorithms

๐Ÿ”ฎ Roadmap

  • Add more graph algorithms (Dijkstra, Bellman-Ford)
  • Include complexity analysis for each solution
  • Add interactive examples/visualizations
  • Create a difficulty level classification
  • Add more test cases
  • Create beginner-friendly guides

๐Ÿ“„ License

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

Copyright (c) 2017 - 2026 Pradeep K. Pant

๐Ÿ‘จโ€๐Ÿ’ป Author

Pradeep K. Pant

  • Started: 2017
  • Python enthusiast | Algorithm lover | Open source advocate

โญ Show Your Support

If this repository helped you learn or prepare for interviews, please consider:

  • โญ Starring the repository
  • ๐Ÿค Contributing improvements
  • ๐Ÿ“ข Sharing with others learning DSA
  • ๐Ÿ’ฌ Giving feedback

Happy Learning! ๐Ÿš€

Releases

No releases published

Packages

 
 
 

Contributors

Languages