Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
algo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bertrand NÉRON
algo
Commits
4f4ff083
Verified
Commit
4f4ff083
authored
5 years ago
by
Bertrand NÉRON
Browse files
Options
Downloads
Patches
Plain Diff
fix typing
parent
07984a8e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Graph/graph/graph.py
+3
-3
3 additions, 3 deletions
Graph/graph/graph.py
with
3 additions
and
3 deletions
Graph/graph/graph.py
+
3
−
3
View file @
4f4ff083
import
itertools
import
itertools
from
typing
import
Gen
erator
,
Optional
from
typing
import
It
erator
,
Optional
class
NDGraph
:
class
NDGraph
:
...
@@ -78,7 +78,7 @@ class Node:
...
@@ -78,7 +78,7 @@ class Node:
return
n
return
n
def
DFS
(
graph
:
Graph
,
node
:
Node
)
->
Gen
erator
[
Node
]:
def
DFS
(
graph
:
ND
Graph
,
node
:
Node
)
->
It
erator
[
Node
]:
"""
"""
**D**epth **F**irst **S**earch.
**D**epth **F**irst **S**earch.
We start the path from the node given as argument,
We start the path from the node given as argument,
...
@@ -102,7 +102,7 @@ def DFS(graph: Graph, node: Node) -> Generator[Node]:
...
@@ -102,7 +102,7 @@ def DFS(graph: Graph, node: Node) -> Generator[Node]:
yield
n
yield
n
def
BFS
(
graph
:
Graph
,
node
:
Node
)
->
Gen
erator
[
Node
]:
def
BFS
(
graph
:
ND
Graph
,
node
:
Node
)
->
It
erator
[
Node
]:
"""
"""
**B**readth **F**irst **s**earch
**B**readth **F**irst **s**earch
We start the path from the node given as argument,
We start the path from the node given as argument,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment