mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2026-02-03 02:24:47 +08:00
Rename dfs extension function
This commit is contained in:
@@ -20,7 +20,7 @@ def graph_dfs(matrix):
|
||||
# Follow up:
|
||||
# 1) Diagonal cells are considered neighbors
|
||||
# 2) View the matrix like Earth, right boundary is adjacent to the left boundary, top adjacent to left, etc.
|
||||
def graph_dfs_diagonals(matrix):
|
||||
def graph_dfs_diagonals_and_boundary_wrap(matrix):
|
||||
rows, cols = len(matrix), len(matrix[0])
|
||||
visited = set()
|
||||
# Change 1: Add 4 more diagonal directions.
|
||||
|
||||
Reference in New Issue
Block a user