[Bona1122] 25.02.13 #44
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[집합]
문제를 풀면서 Set과 서로소집합(Disjoint Set) 알고리즘에 대해 배운 내용과 인사이트를 정리했습니다.
Set의 주요 특징과 활용
서로소집합 알고리즘과 Union, Find
서로소 집합 초기화 - parent 배열
처음에는 각 원소가 자기 자신만을 원소로 가지는 서로소 집합으로 시작 -> 원소의 부모는 자기자신
Find 연산 구현 방식
경로압축을 이용한 Find 최적화
Union 연산 구현 방식
📌 푼 문제
📝 간단한 풀이 과정
대칭 차집합
교집합 개수 = 총 개수 - 합집합 갯수를 통해 교집합에 속하는 개수를 구하고A개수 + B개수 - 2*교집합 개수로 답을 도출했습니다.서로 다른 부분 문자열의 개수
소인수분해
문자열 집합
집합의 표현
친구 네트워크