Skip to content

Commit 297bd56

Browse files
djeadaCopilot
andauthored
Update notes/brain_teasers.md
Co-authored-by: Copilot <[email protected]>
1 parent 889b26a commit 297bd56

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

notes/brain_teasers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ III. *Cycle Detection*:
144144
IV. *Shortest Path Algorithms*:
145145

146146
* With non-negative weights, using *Dijkstra’s algorithm* and a priority queue yields shortest paths efficiently, whereas arbitrary relaxation can be slower or incorrect; for example, computing fastest driving times.
147-
* When negative edges are possible, selecting *BellmanFord* both finds shortest paths and reports negative cycles, whereas Dijkstra may return wrong distances; for example, detecting currency-exchange arbitrage.
147+
* When negative edges are possible, selecting *Bellman-Ford* both finds shortest paths and reports negative cycles, whereas Dijkstra may return wrong distances; for example, detecting currency-exchange arbitrage.
148148
* For all-pairs needs on moderately dense graphs, applying *Floyd–Warshall* precomputes every distance in O(n³), whereas repeating many single-source runs adds overhead; for example, planning shipping costs between warehouses and stores.
149149

150150
V. *Minimum Spanning Trees (MST)*:

0 commit comments

Comments
 (0)