Skip to content

Commit c04a6c4

Browse files
authored
Merge pull request #1566 from Nafyaz/patch-4
Fixed typo in bridge-searching-online.md
2 parents 197319e + d58a69b commit c04a6c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/graph/bridge-searching-online.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ We will now consistently disassemble every operation that we need to learn to im
108108
After finding the cycle we compress all vertices of the detected cycle into one vertex.
109109
This means that we already have a complexity proportional to the cycle length, which means that we also can use any LCA algorithm proportional to the length, and don't have to use any fast one.
110110

111-
Since all information about the structure of the tree is available is the ancestor array `par[]`, the only reasonable LCA algorithm is the following:
111+
Since all information about the structure of the tree is available in the ancestor array `par[]`, the only reasonable LCA algorithm is the following:
112112
mark the vertices $a$ and $b$ as visited, then we go to their ancestors `par[a]` and `par[b]` and mark them, then advance to their ancestors and so on, until we reach an already marked vertex.
113113
This vertex is the LCA that we are looking for, and we can find the vertices on the cycle by traversing the path from $a$ and $b$ to the LCA again.
114114

0 commit comments

Comments
 (0)