mirror of
https://github.com/mfocko/blog.git
synced 2025-05-07 11:52:58 +02:00
fix: use appropriate quotes in English
Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
parent
277213ce23
commit
4ce489459d
10 changed files with 33 additions and 33 deletions
ib002/10-graphs
|
@ -33,7 +33,7 @@ By having a look at the graph we started from, we can see that we have a path
|
|||
|
||||
## Proof by contradiction
|
||||
|
||||
Let's keep the same graph, but break the lower bound, i.e. I have gotten a lower bound $2$, but „there must be a shorter path“! ;)
|
||||
Let's keep the same graph, but break the lower bound, i.e. I have gotten a lower bound $2$, but “there must be a shorter path”! ;)
|
||||
|
||||
Now the more important question, is there a shorter path in that graph? The answer is no, there's no shorter path than the one with length $2$. So what can we do about it? We'll add an edge to have a shorter path. Now we have gotten a lower bound of $2$, which means the only shorter path we can construct has $1$ edge and that is ‹$e, h$› (no intermediary vertices). Let's do this!
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ begin
|
|||
end VisitedDFS;
|
||||
```
|
||||
|
||||
This implementation is correct, does the DFS traversal as it should, however it has one „smallish“ downside and that is the time complexity. The usage of set raises the time complexity, of course it is implementation dependant. However in case of either RB-tree or hash-table implementation, we get look-up in time $\mathcal{O}(n)$ for hash-table in worst-case or $\mathcal{O}(\log n)$ for the other in the worst-case. Both are not ideal compared to checking color on vertex.
|
||||
This implementation is correct, does the DFS traversal as it should, however it has one “smallish” downside and that is the time complexity. The usage of set raises the time complexity, of course it is implementation dependant. However in case of either RB-tree or hash-table implementation, we get look-up in time $\mathcal{O}(n)$ for hash-table in worst-case or $\mathcal{O}(\log n)$ for the other in the worst-case. Both are not ideal compared to checking color on vertex.
|
||||
|
||||
### Iterative DFS from the exercises
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue