Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python DSA Practice Index 📚

Is directory me Python Data Structures and Algorithms (DSA) ke step-by-step topicwise programs implement kiye gaye hain. Har program code ke andar simple Hinglish (Hienglish) documentation/comments hain jo process ko easily samajhne me madad karenge.


🚀 Step-by-Step Index & Links

📶 1. Complexity Analysis

  • Topic: Time and Space complexity aur code performance analysis.
  • Concepts: Big-O Notations ($O(1)$, $O(n)$, $O(n^2)$) ke examples.
  • Code Link: 01_complexity.py

🗂️ 2. Lists & Dynamic Arrays

  • Topic: Python Dynamic Array (List) and key operations complexity.
  • Concepts: append(), insert(), indexing, slicing aur unka runtime performance.
  • Code Link: 02_lists.py

🔗 3. Linked Lists

  • Topic: Memory layout of elements (Nodes) connected using pointers.
  • Concepts: Singly Linked List (Node structure), insert at start/end, and deletion by value.
  • Code Link: 03_linked_list.py

🥞 4. Stacks & Queues

  • Topic: Stacks (LIFO) aur Queues (FIFO) custom logic.
  • Concepts: Efficient double-ended queue using collections.deque and custom Stack/Queue implementations.
  • Code Link: 04_stacks_queues.py

🔍 5. Searching Algorithms

  • Topic: Array values search karna.
  • Concepts: Linear Search vs Binary Search (Sorted elements rule).
  • Code Link: 05_searching.py

📊 6. Sorting Algorithms

  • Topic: Elements ko sorting order me convert karna.
  • Concepts: Bubble Sort (Brute-force) aur Merge Sort (Divide & Conquer) implementation.
  • Code Link: 06_sorting.py

🔁 7. Recursion & Backtracking

  • Topic: Self-calling functions aur trial-and-error problems.
  • Concepts: Factorial calculation (base case rule) aur Power Set generator backtracking code.
  • Code Link: 07_recursion.py

🌳 8. Binary Search Tree (BST)

  • Topic: Hierarchical non-linear storage.
  • Concepts: Left < Root < Right insertion logic aur Sorted output using Inorder Traversal.
  • Code Link: 08_trees_bst.py

🕸️ 9. Graphs

  • Topic: Network structure of vertices and edges.
  • Concepts: Graph implementation using Adjacency List, BFS (Level-by-Level), aur DFS traversals.
  • Code Link: 09_graphs.py

🧩 10. Dynamic Programming & Greedy Basics

  • Topic: Optimizing algorithms using caching or locally best choice strategy.
  • Concepts: Top-down Memoization & Bottom-up Tabulation for Fibonacci, and Coin Change greedy choice.
  • Code Link: 10_dp_greedy.py

🔑 11. Hash Maps & Dictionaries

  • Topic: Efficient Key-Value pair storage (Hash Table) and membership check.
  • Concepts: Built-in dict and set operations, Hashing & Collision theory, and Two Sum O(n) hashmap resolution.
  • Code Link: 11_hashmaps_dictionaries.py

↔️ 12. Two Pointers & Sliding Window

  • Topic: Array and list optimization patterns to avoid nested O(n^2) loops.
  • Concepts: Boundary pointers traversal (Target Sum) and Sliding Window subarray sum shift mechanism.
  • Code Link: 12_two_pointers_sliding_window.py

🔗🔗 13. Doubly Linked Lists

  • Topic: Dynamic linked nodes with both forward and backward connections.
  • Concepts: Insertions, DLL Node representation, and traversing forwards & backwards.
  • Code Link: 13_doubly_linked_list.py

🏔️ 14. Heaps & Priority Queues

  • Topic: Binary tree heap structure to access min/max values in O(1).
  • Concepts: heapq module for Min-Heap, negative values for Max-Heap, and K-th largest element solution.
  • Code Link: 14_heaps_priority_queues.py

⚡ 15. Selection & Quick Sort

  • Topic: Comparison and partition sorting models.
  • Concepts: Linear minimum lookup (Selection sort) and pivot-based element partitioning (Quick Sort).
  • Code Link: 15_quicksort_selectionsort.py

🌳🍂 16. Tree Traversals

  • Topic: Deep and wide traversals of Tree structures.
  • Concepts: DFS Traversals (Pre-order, Post-order) and BFS Level-order traversal using queue.
  • Code Link: 16_tree_traversals.py

🗺️ 17. Dijkstra's Shortest Path

  • Topic: Shortest route optimization in weighted graphs.
  • Concepts: Priority queue greedy logic to find minimum cost path from source.
  • Code Link: 17_dijkstra_graph.py

🔢 18. Bit Manipulation

  • Topic: Fast register calculations using binary bit operations.
  • Concepts: XOR tricks (Single Number Finder) and Even/Odd check without modulo.
  • Code Link: 18_bit_manipulation.py

🛠️ Mini Project

🚇 Metro Route Finder & Navigation System

  • Description: Ek interactive CLI application jo metro routing aur shortest path lookup handle karti hai.
  • DSA Utilized: Graphs (Adjacency List), Dijkstra's Algorithm (Time optimization), BFS (Minimum Stops), aur Hash Maps (Lookup).
  • Code Link: mini_project_metro.py

💻 How to Run the Files?

Aap kisi bhi Python file ko execute karke outputs aur implementation results console par dekh sakte hain:

python 01_complexity.py
python mini_project_metro.py

⚙️ Run All Scripts Test Runner

Maine ek automatic script run_all.py banayi hai jo saari files ko ek sath ya serial wise execute kar sakti hai. ise run karne ke liye terminal me type karein:

python run_all.py

About

Beginner-friendly Python Data Structures & Algorithms — bite-sized examples and a mini project.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages