Tag: depth_first_search
Network Delay Time - Depth First Search Approach
Date: 3/7/2024Tags:algorithmsleetcodegraphdepth_first_searchThe journal entry explores a depth-first search approach for the Network Delay Time problem, updating distances between source nodes and vertices to find the maximum time needed, implemented in the provided code snippet.
Binary Right Side View - DFS approach
Date: 3/2/2024Tags:algorithmsleetcodebinary_treedepth_first_searchUsing a depth-first search approach, this journal entry explores the problem of finding the right side view of a binary tree by ensuring traversal prioritizes the rightmost node at each level, resulting in an algorithm that populates a 'rightside' list with the correct nodes seen from the right side.
Walls and Gates - Depth-First Search
Date: 2/21/2024Tags:algorithmsleetcodegraphdepth_first_searchThe journal entry explores a depth-first search approach for the "Walls and Gates" problem, highlighting how it is faster than breadth-first search due to its ability to mark nodes with their shortest distance from a gate by exploring paths as far as possible before backtracking, contrasted with BFS's level-by-level exploration that can lead to redundant checks, presented alongside an accompanying DFS code implementation.
Pacific Atlantic Water Flow - Depth-First Search
Date: 2/21/2024Tags:algorithmsleetcodedepth_first_searchThis DFS approach uses recursive functions to find paths furthest reachable for each node compared to BFS, implementing logic in a TypeScript code snippet for determining Pacific and Atlantic water flow connections in a matrix of heights.