BFS
DFS
Union find
Find: Given an element, returns the set to which this element belongs. Find generally returns an element that "represents" the set to which an element belongs, and for this purpose, it is determined that it is the same set by comparing the find result between a certain element and each representative element.
Union: Combines two sets into one set.
More detailed code can be found through the following link.
https://github.com/hotchya/basic-algorithm/tree/main/data%20sturcture/bfs_dfs
'Algorithm' 카테고리의 다른 글
a^3 + b^3 = c^3 + d^3 (0) | 2021.11.02 |
---|---|
Data structure - Heap (0) | 2021.09.12 |
Brute force - Symmetric key encryption (0) | 2021.09.12 |