🚀 Just built my own Pathfinding Algorithm Visualizer from scratch! I’m excited to share my latest project: a real-time Pathfinding Algorithm Visualizer built with Python and JavaScript. Over the last few weeks, I’ve been on a "speedrun" of Data Structures & Algorithms for my academic exams. I wanted to go beyond just reading the theory—I wanted to truly understand and visualize how algorithms like Dijkstra, BFS, and DFS explore data. Instead of just memorizing them, I built a tool to watch them think. ✨ Key Features: Real-time Visualization: Watch algorithms traverse the grid node-by-node. Interactive Controls: Draw walls, move start/end nodes, and reset the grid instantly. Comparison: See the difference between the "concentric rings" of BFS versus the "winding snake" of DFS. 🛠️ Tech Stack & Architecture: I used the Eel framework to bridge a Python backend with a modern Vanilla JS frontend. What started as just another Python task turned into a full-stack challenge that I really enjoyed. You can see exactly how the system components talk to each other here: 👉 System Architecture Doc : https://lnkd.in/d_QRR5rC This project was a fantastic way to deepen my understanding of Graph Theory while implementing a clean, interactive architecture. Check out the full code on GitHub! 👇 [https://lnkd.in/dcSVaNA7] #Python #Algorithms #DataStructures #ComputerScience #WebDevelopment #Coding #Project #GraphTheory #DSA #BFS #DFS
Md Nowroz Imtiaz Rifat’s Post
More Relevant Posts
-
🚀 PoC: Simple Rate Limiting with FastAPI Rate limiting is essential to keep APIs fast and stable by controlling request frequency. In this PoC, we demonstrate a simple fixed window rate limiting approach. This protects your API from overload by limiting each client to 10 requests per minute. 🔹 Endpoints: - GET /api/gis/vehicles - GET /api/gis/features 🔹 Rate Limiting: - Fixed window (60 seconds) - 10 requests/minute per client (by header or IP) - Returns HTTP 429 with a clear message if exceeded 🔹 Architecture: - In-memory store - Simple, clean code - Easy to test with curl Check out the full PoC, code, and blog post for details and a Mermaid diagram! 👇 https://lnkd.in/dyQcBwmT #Python #FastAPI #GIS #RateLimiting #API #PoC #Backend #SoftwareEngineering #OpenSource
To view or add a comment, sign in
-
-
LeetCode Daily Challenge – Minimum Cost to Convert String 🔍 Problem Summary We are given two strings source and target. We can convert one character to another using some given rules, each with a cost. Our goal is to find the minimum total cost to convert source into target. If it’s not possible, return -1. 💡 Pattern Used Graph + Shortest Path (Dijkstra) Characters (a–z) are nodes Conversion rules are weighted edges Find the minimum cost path between characters 🛠️ Approach Build a graph from original → changed with costs Use Dijkstra to find shortest paths between all characters Store results in a 26 × 26 cost matrix For each index in source: Add the cost to convert source[i] → target[i] If conversion is impossible, return -1 ⏱️ Time & Space Complexity Time Complexity Dijkstra runs 26 times Each run: O(E log V) Since V = 26, total time is very small 👉 Overall: O(26 × E log 26) ≈ O(E) Space Complexity Cost matrix: 26 × 26 Graph storage 👉 Overall: O(26² + E) 🧠 Tricks & Tips Always precompute shortest paths for character problems Use ord(char) - ord('a') to map characters to indices Avoid iterating directly over defaultdict.keys() while running Dijkstra Skip Dijkstra updates if current distance is already larger (heap optimization) ✅ Key Takeaway When a problem involves transformations + costs, 👉 Think of it as a graph problem 👉 Shortest path algorithms save the day Happy coding 🚀 #LeetCode #DailyChallenge #Graphs #Dijkstra #Python
To view or add a comment, sign in
-
-
𝗩𝗶𝘀𝘂𝗮𝗹𝗶𝘇𝗶𝗻𝗴 𝗥𝗔𝗚: 𝗔 𝗹𝗼𝗼𝗸 𝗶𝗻𝘀𝗶𝗱𝗲 𝘁𝗵𝗲 𝘃𝗲𝗰𝘁𝗼𝗿 𝗲𝗺𝗯𝗲𝗱𝗱𝗶𝗻𝗴𝘀. I’ve been working with RAG (Retrieval Augmented Generation) for a while, but I often found the retrieval step to be a bit of a "black box." I wanted to understand exactly why the model retrieves certain chunks and ignores others. To explore this, I built a visualization tool using FastAPI, React, and UMAP. The goal was to see the math behind the "magic"—watching how high-dimensional vector embeddings cluster together and how cosine similarity actually looks when a query matches a document. What the demo shows: • Ingestion: Uploading a raw PDF and chunking it. • Visualization: Projecting the vector embeddings into 2D space. • Inspection: Comparing the query vector against the document vector to see the semantic alignment. It’s been a great way to build intuition around vector collapse and embedding quality. I’ve open-sourced the code in case anyone else finds it useful for debugging their own RAG pipelines. I’m also open to suggestions on how to improve the clustering logic. 🔗 Repo: https://lnkd.in/gSRBpWV3 #RAG #MachineLearning #DataVisualization #Python #OpenSource
To view or add a comment, sign in
-
Day 52 of 1022. Sum of Root To Leaf Binary Numbers Today’s problem was a great mix of binary representation + tree traversal. Each root-to-leaf path in the binary tree forms a binary number, and the goal is to compute the sum of all those numbers efficiently. Key Insight: Instead of storing the entire path, we can build the number on the go using: ➡️ current = (current << 1) | node.val This is equivalent to: Left shift → multiply by 2 Add current bit Reached a leaf node? That means we formed one complete binary number → add it to the result. 🌱 What I practiced today: ✔ Depth First Search (DFS) ✔ Bit Manipulation in Trees ✔ Writing clean recursive logic ✔ Optimizing space by avoiding extra storage ⏱ Time Complexity: O(n) 📦 Space Complexity: O(h) – recursion stack ✨ This problem is a perfect example of how combining concepts (Trees + Bits) leads to elegant solutions. Consistency is the real key 🔑 — learning something new every single day! #Day52 LeetCode BinaryTree DSA Journey Coding JavaScript Notes #Python #ProblemSolving TechGrowth
To view or add a comment, sign in
-
-
🚀 Day 8/30 | LeetCode Problem: Sort Colors (75) Problem: Given an array nums containing only 0s, 1s, and 2s, sort the array in-place so that colors are ordered as: 🔴 0 → ⚪ 1 → 🔵 2 Without using the built-in sort function. 🧠 Approach: Dutch National Flag Algorithm We use three pointers: a → position for 0 (left) b → position for 2 (right) c → current index Logic: If nums[c] == 0 → swap with a, move both forward If nums[c] == 2 → swap with b, move b backward If nums[c] == 1 → just move c This sorts the array in one pass. ⏱️ Complexity Time: O(n) Space: O(1) (in-place) 🧾 Python Code class Solution: def sortColors(self, nums): a = 0 # left pointer (0s) b = len(nums) - 1 # right pointer (2s) c = 0 # current index while c <= b: if nums[c] == 0: nums[a], nums[c] = nums[c], nums[a] a += 1 c += 1 elif nums[c] == 2: nums[b], nums[c] = nums[c], nums[b] b -= 1 else: c += 1 ✅ Result Accepted ✅ Runtime: 0 ms (Beats 100%) In-place & optimal solution 🎯 Takeaway Understanding pointer-based algorithms helps solve array problems efficiently without extra space . 🔖 Hashtags #LeetCode #30DaysOfLeetCode #Day8 #Python #Arrays #TwoPointers #DSA #ProblemSolving #CodingJourney #SoftwareEngineering
To view or add a comment, sign in
-
-
Explore the Weather Like Never Before with My 7-Day Forecast Dashboard! I’ve built an interactive weather dashboard using Python, Streamlit, and Open-Meteo API, designed to explore 7-day weather forecasts for any city. 𝗞𝗘𝗬 𝗛𝗜𝗚𝗛𝗟𝗜𝗚𝗛𝗧𝗦: - Displays maximum & minimum temperature, humidity, precipitation, and visibility - Interactive charts for temperature & humidity trends - Clean, modern dark-themed UI with responsive weather cards - Easy to use. Just enter a city and explore Try it live: https://lnkd.in/dUE9ahkW Check the code & README for all features and how it works: https://lnkd.in/dC97azS7 This project demonstrates my skills in API integration, data visualization, and building interactive Python web apps. Would love to hear your feedback! #Python #Streamlit #WebApp #DataVisualization #WeatherApp #TechProject
To view or add a comment, sign in
-
🚀 169. Majority Element — Two Approaches Explained Recently solved LeetCode 169 – Majority Element. Given an array of size n, find the element that appears more than [n/2] times. The problem guarantees that a majority element always exists. 🔗 Code: https://lnkd.in/g-PRARDb Approach 1: Sorting the Array 💡 Idea If the majority element appears more than n/2 times, after sorting it will always occupy the middle position. 🔎 Why it Works? If a number appears more than half the time, it must cross the middle index in the sorted array. ⏱ Time Complexity Sorting takes O(n log n) 🗂 Space Complexity O(1) (ignoring sorting internal space) Approach 2: Boyer–Moore Voting Algorithm (Optimal) 💡 Idea Keep a candidate and a count. If count becomes 0 → change candidate If number matches candidate → increment Else → decrement Majority element survives because it appears more than all others combined. 🔎 Why it Works? Since majority element appears more than n/2 times, it cannot be fully cancelled out. ⏱ Time Complexity O(n) (single pass) 🗂 Space Complexity O(1) (constant extra space) 💡 Try this problem and implement both approaches — it’s a great example of optimizing from a basic solution to an optimal one. #LeetCode #DSA #Python #CodingInterview #Algorithms #100DaysOfCode #ProblemSolving #LeetCode #CodingChallenge #DataStructures #Algorithms #PythonProgramming #100DaysOfCode #ProblemSolving #SoftwareEngineering #TechCareer #InterviewPrep #CodeNewbie #Developers #TechCommunity #ProgrammingLife
To view or add a comment, sign in
-
-
After learning Flask, I’m now diving into FastAPI — and the difference is exciting. 🚀 FastAPI gives me built-in data validation, automatic API docs, async performance, and cleaner, more scalable architecture out of the box. Even better, by using Jinja2 templates with FastAPI, I can still build full web applications — not just APIs — combining modern backend performance with traditional server-rendered pages. Best of both worlds. The animated gif shows a blog web application I am building as I follow the excellent Python FastAPI Tutorial series on YouTube created by Corey Schafer. Source code: https://lnkd.in/eaNkVYHb #FastAPI #Flask #Python #WebDevelopment #APIDevelopment #BackendEngineering #SoftwareEngineering #LearningJourney
To view or add a comment, sign in
-
-
🚀 LeetCode: Map Word Weights The goal is to calculate a transformation of words based on a given weight array and map the resulting total weight (modulo 26) to a character from a reversed alphabet. 🛠️ My Approach 1. Weight Calculation: I iterated through each word and calculated its total weight by mapping each character to its corresponding value in the weights array using charCodeAt(0) - 97. ⚖️ 2. Reversed Mapping: Instead of complex math to find the character, I used a pre-defined reversed_alpha string. By taking the totalWeight % 26, I could instantly grab the correct character. 🔡 3. Optimization: By using a nested loop structure and direct index access, I ensured the logic remains lean and lightning-fast. ⚡ 📊 Efficiency Analysis ⏱️ Time Complexity: O(N * M) where 'N' is the number of words and 'M' is the average length of each word. 💾 Space Complexity: O(1) (excluding the result string) as the alphabet mapping and variables use constant space. #LeetCode #JavaScript #CodingLife #Algorithms #WebDevelopment #ProblemSolving #SoftwareEngineering #TechCommunity
To view or add a comment, sign in
-
-
Day 4 of #200DaysOfCode! 🚀 After tackling "3Sum" yesterday, I decided to circle back to the problem that started it all for many of us: "Two Sum" (LeetCode 1). While this is often the first problem developers solve, revisiting it with a focus on optimization is always valuable. The Strategy: Space vs. Time Yesterday, for 3Sum, I used sorting and pointers to save space. Today, for Two Sum, I used a Hash Map (Dictionary) to maximize speed. The Logic (One-Pass Hash Map): Instead of using a nested loop to find a pair (which would be a slow O(N^2)), I utilized a dictionary to "remember" the numbers I've seen so far. Iterate through the array. Calculate the complement: diff = target - nums[i]. Check if this diff already exists in our dictionary. If yes, we found our pair! Return the indices immediately. If no, store the current number and its index in the dictionary for future lookups. This approach trades a bit of memory O(N) for a massive gain in speed, bringing the time complexity down to a linear O(N). The Result: My Python solution hit a perfect 0 ms runtime, beating 100.00% of submissions. ⚡ It’s fascinating how different data structures (Hash Maps vs. Pointers) solve similar "Sum" problems in completely different ways. Day 4 down. The foundation is solid. 🧱 Which pattern do you prefer implementing: The "Two Pointer" dance or the "Hash Map" lookup? 👇 #200DaysOfCode #Python #LeetCode #TwoSum #Algorithms #HashMap #DataStructures #ProblemSolving #DeveloperJourney #Optimization
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development