Close Menu
    Code and Debug
    • Home
    • Our Courses
    • Blog
    • About Us
    • Contact Us
    Facebook X (Twitter) Instagram YouTube WhatsApp
    • Home
    • Our Courses
    • Blog
    • About Us
    • Contact Us
    Facebook Instagram YouTube LinkedIn WhatsApp

    Code and Debug – BlogCode and Debug – Blog

    Code and Debug – BlogCode and Debug – Blog
    Data Structures & Algorithms

    Shortest Path in a Weighted Directed Acyclic Graph | Topological-Sort + Relaxation | Python

    5 Mins Read

    Learn how to find single source shortest path in a weighted directed acyclic graph (DAG) in linear time. We explain…

    Data Structures & Algorithms

    Shortest Path in an Undirected Graph with Unit Distance – Clear BFS Solution in Python

    4 Mins Read

    Find the Shortest Path in an Undirected Graph from a source to every other node when every edge costs 1.…

    Data Structures & Algorithms

    Check if array is sorted | Explained using Python Code

    2 Mins Read

    Learn a one-pass way to check if array is sorted in non-decreasing order. Intuition, commented Python code, dry run, and…

    Data Structures & Algorithms

    Find the second largest and second smallest element in an Array | Explained

    4 Mins Read

    Need the second smallest and second largest in one array? We compare a clear two-pass “better” method with a one-pass…

    Data Structures & Algorithms

    Quick Sort Algorithm in Python | Explained

    5 Mins Read

    Quick Sort is a popular sorting algorithm that follows a divide-and-conquer approach. When implemented well, Quick Sort can be extremely…

    Data Structures & Algorithms

    Merge Sort Algorithm in Python | Explained

    4 Mins Read

    Merge Sort is a classic divide-and-conquer sorting technique. It divides the list into two halves, sorts each half recursively, and…

    Data Structures & Algorithms

    Insertion Sort Algorithm | Explained in Python

    4 Mins Read

    Master insertion sort step by step. See how each element “inserts” into its correct place, watch a detailed dry run,…

    Data Structures & Algorithms

    Find Eventual Safe States | Leetcode 802 | DFS Solution

    5 Mins Read

    Learn how to list all “eventual safe” nodes in a directed graph. We use DFS with path-tracking to spot cycles…

    Data Structures & Algorithms

    Find Eventual Safe States | Leetcode 802 | Kahn’s Algorithm (BFS) Solution

    5 Mins Read

    We flip the graph, run Kahn’s topological BFS, and list every node guaranteed to avoid cycles. Includes clear intuition, step-by-step…

    Data Structures & Algorithms

    Course Schedule | Leetcode 207 | Kahn’s Algorithm Walk-through in Python

    5 Mins Read

    Check if you can finish every course when some need to be done first. We build the course graph, run…

    1 2 3 … 6 Next
    Categories
    • Data Structures & Algorithms (50)
      • Beginner (24)
      • Expert (9)
      • Intermediate (17)
    • Uncategorised (1)
    Recent Posts

    Shortest Path in a Weighted Directed Acyclic Graph | Topological-Sort + Relaxation | Python

    17 June 2025

    Shortest Path in an Undirected Graph with Unit Distance – Clear BFS Solution in Python

    13 June 2025

    Check if array is sorted | Explained using Python Code

    13 June 2025

    Find the second largest and second smallest element in an Array | Explained

    13 June 2025

    Quick Sort Algorithm in Python | Explained

    13 June 2025
    Facebook Instagram YouTube LinkedIn WhatsApp
    © 2025 Code and Debug. All rights reserved.

    Type above and press Enter to search. Press Esc to cancel.