Skip to content

gnsalok/algo-ds-python

Repository files navigation

Algorithms and Data Structures using Python

Python Version License

Welcome to the "Algorithms and Data Structures using Python" repository! This is a comprehensive learning resource that covers fundamental algorithms and data structures implemented in Python 3. Whether you're a student learning computer science concepts, a developer looking to strengthen your algorithmic thinking, or someone preparing for technical interviews, this repository aims to help you understand these crucial concepts through practical Python implementations.

📚 Learning Path

This repository is organized to provide a structured learning path. Each topic includes:

  • Theoretical explanations / Problems links
  • Python implementations
  • Example use cases
  • Time and space complexity analysis
  • Visual explanations (where applicable)

🔧 Prerequisites

  • Basic understanding of Python programming or Look at ./coding-interview-problems/5-python3/ guide.
  • Python 3.x installed on your machine
  • Familiarity with basic programming concepts (variables, loops, functions)

Setting Up Your Environment

  1. Install Python from the official Python website
  2. Clone this repository:
    git clone https://github.com/gnsalok/algo-ds-python.git
    cd algo-ds-python

📖 Data Structures

Basic Data Structures

  1. Arrays and Lists

    • Dynamic arrays
    • Multi-dimensional arrays
    • Array operations and their complexity
  2. Linked Lists

    • Singly linked lists
    • Doubly linked lists
    • Circular linked lists
    • Common operations and their implementations
  3. Stacks and Queues

    • Stack implementations and applications
    • Queue variations (simple queue, circular queue)
    • Priority queues
    • Deques (double-ended queues)

Advanced Data Structures

  1. Trees

    • Binary trees
    • Binary search trees (BST)
    • AVL trees
    • Red-black trees
    • B-trees
    • Segment trees
  2. Heaps

    • Min heaps
    • Max heaps
    • Heap operations
    • Heapify process
  3. Hash-Based Structures

    • Hash tables
    • Hash maps
    • Collision resolution techniques
    • Hash functions
  4. Graphs

    • Graph representations (adjacency matrix, adjacency list)
    • Weighted and unweighted graphs
    • Directed and undirected graphs
  5. Tries

    • Basic trie operations
    • Prefix trees
    • Applications in string processing

🎯 Algorithms

Searching Algorithms

  • Linear search
  • Binary search
  • Interpolation search
  • Jump search

Sorting Algorithms

  • Bubble sort
  • Selection sort
  • Insertion sort
  • Merge sort
  • Quick sort
  • Heap sort
  • Counting sort
  • Radix sort

Graph Algorithms

  • Depth-First Search (DFS)
  • Breadth-First Search (BFS)
  • Dijkstra's algorithm
  • Bellman-Ford algorithm
  • Kruskal's algorithm
  • Prim's algorithm

Pattern Matching and String Algorithms

  • KMP algorithm
  • Rabin-Karp algorithm
  • Boyer-Moore algorithm
  • String matching and manipulation

Advanced Algorithmic Techniques

  1. Recursion

    • Base cases and recursive cases
    • Recursive problem-solving
    • Stack frames and memory usage
  2. Dynamic Programming

    • Memoization
    • Tabulation
    • Common DP patterns
  3. Greedy Algorithms

    • Activity selection
    • Huffman coding
    • Fractional knapsack
  4. Backtracking

    • State space tree
    • Constraint satisfaction
    • Optimization problems

[!NOTE] : Few topics are not covered yet. Feel free to contribute.

📚 Learning Resources

Online Resources

🤝 Contributing

We welcome contributions from the community! Whether you're fixing bugs, adding new features, or improving documentation, your help is appreciated.

How to Contribute

  1. Fork the Repository

    • Click the 'Fork' button at the top right of this page
    • Clone your fork locally: git clone https://github.com/YOUR-USERNAME/algo-ds-python.git
  2. Create a Branch

    git checkout -b feature/your-feature-name
    # or
    git checkout -b fix/your-fix-name
  3. Make Your Changes

    • Add your implementation
    • Follow the Python Style Guide (PEP 8)
    • Add appropriate comments and documentation
    • Include test cases if applicable
  4. Test Your Changes

    • Ensure your code works as expected
    • Run any existing tests
    • Add new tests if needed
  5. Commit Your Changes

    git add .
    git commit -m "Brief description of your changes"
  6. Push to GitHub

    git push origin feature/your-feature-name
  7. Submit a Pull Request

    • Go to your fork on GitHub
    • Click 'New Pull Request'
    • Select your feature branch
    • Add a meaningful title and description

Contribution Guidelines

  • Follow Python best practices and PEP 8 style guide
  • Include docstrings for functions and classes
  • Add comments explaining complex logic
  • Update documentation if needed
  • Include example usage where appropriate
  • Add test cases for new features

What to Contribute

  • New algorithms or data structures
  • Improvements to existing implementations
  • Bug fixes
  • Documentation improvements
  • Test cases
  • Example use cases
  • Performance optimizations

For more detailed guidelines, please check our CONTRIBUTING.md file.

👨‍💻 Lead Maintainer

Alok Tripathi

Connect With Me

📄 License

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

About

Data Structures and Algorithms using Python

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages