Skip to content

Commit a822cbe

Browse files
committedMay 17, 2022
add readme for graph
1 parent 868fc7c commit a822cbe

File tree

1 file changed

+13
-0
lines changed
  • computer_science/data_structures/graph

1 file changed

+13
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Graph
2+
3+
## Breadth First Search (BFS)
4+
5+
- Use the queue data structure to hold each vertex that needs to be visited in the future.
6+
- It should keep a visited data structure to store all the visited vertices.
7+
- Runtime: O(V+E) / V = vertices | E = edges.
8+
9+
## Depth First Search (DFS)
10+
11+
- Use the stack data structure or do recursive.
12+
- It should keep a visited data structure to store all the visited vertices.
13+
- Runtime: O(V+E) / V = vertices | E = edges.

0 commit comments

Comments
 (0)
Please sign in to comment.