You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -403,13 +403,13 @@ BFS layers (distance mod 10):
403
403
Legend: walls (#), goal reached (X)
404
404
```
405
405
406
-
BFS explores in **expanding “rings”**; with 4-dir edges, each step increases Manhattan distance by 1 (unless blocked). Time \$O(RC)\$, space \$O(RC)\$ with a visited matrix/queue.
406
+
BFS explores in **expanding “rings”**; with 4-dir edges, each step increases Manhattan distance by 1 (unless blocked). Time $O(RC)$, space $O(RC)$ with a visited matrix/queue.
407
407
408
408
**Obstacles / costs / diagonals.**
409
409
410
-
* Obstacles: skip neighbors that are `#` (or where cost is \$\infty\$).
410
+
* Obstacles: skip neighbors that are `#` (or where cost is $\infty$).
411
411
* Weighted grids: Dijkstra / 0-1 BFS on the same neighbor structure.
412
-
* 8-dir with Euclidean costs: use \$1\$ for orthogonal moves and \$\sqrt{2}\$ for diagonals (A\* often pairs well here with an admissible heuristic).
412
+
* 8-dir with Euclidean costs: use $1$ for orthogonal moves and $\sqrt{2}$ for diagonals (A\* often pairs well here with an admissible heuristic).
413
413
414
414
**Common symbols:**
415
415
@@ -428,7 +428,7 @@ Find the minimum steps from S to T.
428
428
*Example*
429
429
430
430
$$
431
-
\text{Grid (0 = open, 1 = wall), } S = (0,0),\; T = (2,3)
431
+
\text{Grid (0 = open, 1 = wall), } S = (0,0), T = (2,3)
0 commit comments