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.
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)
- 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)
- Install Python from the official Python website
- Clone this repository:
git clone https://github.com/gnsalok/algo-ds-python.git cd algo-ds-python
-
Arrays and Lists
- Dynamic arrays
- Multi-dimensional arrays
- Array operations and their complexity
-
Linked Lists
- Singly linked lists
- Doubly linked lists
- Circular linked lists
- Common operations and their implementations
-
Stacks and Queues
- Stack implementations and applications
- Queue variations (simple queue, circular queue)
- Priority queues
- Deques (double-ended queues)
-
Trees
- Binary trees
- Binary search trees (BST)
- AVL trees
- Red-black trees
- B-trees
- Segment trees
-
Heaps
- Min heaps
- Max heaps
- Heap operations
- Heapify process
-
Hash-Based Structures
- Hash tables
- Hash maps
- Collision resolution techniques
- Hash functions
-
Graphs
- Graph representations (adjacency matrix, adjacency list)
- Weighted and unweighted graphs
- Directed and undirected graphs
-
Tries
- Basic trie operations
- Prefix trees
- Applications in string processing
- Linear search
- Binary search
- Interpolation search
- Jump search
- Bubble sort
- Selection sort
- Insertion sort
- Merge sort
- Quick sort
- Heap sort
- Counting sort
- Radix sort
- Depth-First Search (DFS)
- Breadth-First Search (BFS)
- Dijkstra's algorithm
- Bellman-Ford algorithm
- Kruskal's algorithm
- Prim's algorithm
- KMP algorithm
- Rabin-Karp algorithm
- Boyer-Moore algorithm
- String matching and manipulation
-
Recursion
- Base cases and recursive cases
- Recursive problem-solving
- Stack frames and memory usage
-
Dynamic Programming
- Memoization
- Tabulation
- Common DP patterns
-
Greedy Algorithms
- Activity selection
- Huffman coding
- Fractional knapsack
-
Backtracking
- State space tree
- Constraint satisfaction
- Optimization problems
[!NOTE] : Few topics are not covered yet. Feel free to contribute.
- Think Like a Programmer
- Recursion Fundamentals
- Backtracking Concepts
- Dynamic Programming Guide
- Recursion and Backtracking
- Post Order Traversal
We welcome contributions from the community! Whether you're fixing bugs, adding new features, or improving documentation, your help is appreciated.
-
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
-
Create a Branch
git checkout -b feature/your-feature-name # or git checkout -b fix/your-fix-name
-
Make Your Changes
- Add your implementation
- Follow the Python Style Guide (PEP 8)
- Add appropriate comments and documentation
- Include test cases if applicable
-
Test Your Changes
- Ensure your code works as expected
- Run any existing tests
- Add new tests if needed
-
Commit Your Changes
git add . git commit -m "Brief description of your changes"
-
Push to GitHub
git push origin feature/your-feature-name
-
Submit a Pull Request
- Go to your fork on GitHub
- Click 'New Pull Request'
- Select your feature branch
- Add a meaningful title and description
- 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
- 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.
This project is licensed under the MIT License - see the LICENSE.md file for details.