Graph theory

Apr
03
2024
0

Daily Question – 79. Word Search

Description: https://leetcode.com/problems/word-search/description/?envType=daily-question&envId=2024-04-03 Notes: BFS and backtracking. Using a boolean 2-D array to reserve the status of...

Feb
25
2024
0

Daily Question – *2709. Greatest Common Divisor Traversal

We can translate the question into: ‘Consider each number as a node in a graph, and if the greatest common divisor (gcd) of two numbers is not 1, then link them. Check if the graph is connected.’

Feb
23
2024
0

Daily Question – *0787. Cheapest Flights Within K Stops

This is a typical graph theory problem that could be solved by using the Dijkstra algorithm. Since it has a limitation, we could use the SPFA (Shortest Path Faster Algorithm).