mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2026-05-11 10:40:30 +08:00
chore: remove freeform questions
This commit is contained in:
@@ -27,7 +27,7 @@ A tree-like diagram could very well be a graph that allows for cycles and a naiv
|
||||
- **Uncommon** - Topological Sort, Dijkstra's algorithm
|
||||
- **Rare** - Bellman-Ford algorithm, Floyd-Warshall algorithm, Prim's algorithm, Kruskal's algorithm
|
||||
|
||||
In coding interviews, graphs are commonly represented as 2-D matrices where cells are the nodes and each cell can traverse to its adjacent cells (up/down/left/right). Hence it is important that you be familiar with traversing a 2-D matrix. When traversing the matrix, always ensure that your current position is within the boundary of the matrix and has not been visited before.
|
||||
In coding interviews, graphs are commonly represented as 2-D matrices where cells are the nodes and each cell can traverse to its adjacent cells (up/down/left/right). Hence it is important that you be familiar with traversing a 2-D matrix. When traversing the matrix, always ensure that your current position is within the boundary of the matrix and has not been visited before.
|
||||
|
||||
A simple template for doing depth-first searches on a matrix goes like this:
|
||||
|
||||
@@ -101,23 +101,13 @@ For additional tips on BFS and DFS, you can refer to this [LeetCode post](https:
|
||||
- Disjoint graphs
|
||||
- Graph with cycles
|
||||
|
||||
## Recommended Leetcode questions
|
||||
## Recommended LeetCode questions
|
||||
|
||||
- [Clone Graph](https://leetcode.com/problems/clone-graph/)
|
||||
- [Course Schedule](https://leetcode.com/problems/course-schedule/)
|
||||
- [Pacific Atlantic Water Flow](https://leetcode.com/problems/pacific-atlantic-water-flow/)
|
||||
- [Number of Islands](https://leetcode.com/problems/number-of-islands/)
|
||||
- [Longest Consecutive Sequence](https://leetcode.com/problems/longest-consecutive-sequence/)
|
||||
- [Alien Dictionary (Leetcode Premium)](https://leetcode.com/problems/alien-dictionary/)
|
||||
- [Graph Valid Tree (Leetcode Premium)](https://leetcode.com/problems/graph-valid-tree/)
|
||||
- [Number of Connected Components in an Undirected Graph (Leetcode Premium)](https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph/)
|
||||
|
||||
## More questions
|
||||
|
||||
- Given a list of sorted words from an alien dictionary, find the order of the alphabet.
|
||||
- Alien Dictionary Topological Sort question.
|
||||
- Find if a given string matches any path in a labeled graph. A path may contain cycles.
|
||||
- Given a bipartite graph, separate the vertices into two sets.
|
||||
- You are a thief trying to sneak across a rectangular 100 x 100m field. There are alarms placed on the fields and they each have a circular sensing radius which will trigger if anyone steps into it. Each alarm has its own radius. Determine if you can get from one end of the field to the other end.
|
||||
- Given a graph and two nodes, determine if there exists a path between them.
|
||||
- Determine if a cycle exists in the graph.
|
||||
- [Alien Dictionary (LeetCode Premium)](https://leetcode.com/problems/alien-dictionary/)
|
||||
- [Graph Valid Tree (LeetCode Premium)](https://leetcode.com/problems/graph-valid-tree/)
|
||||
- [Number of Connected Components in an Undirected Graph (LeetCode Premium)](https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph/)
|
||||
|
||||
Reference in New Issue
Block a user