[프로그래머스] 섬 연결하기 #118
ghdcksgml1
started this conversation in
1일 1알고리즘
Replies: 1 comment
-
|
이런것도 있구만 주말에 함 조져본다 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
https://programmers.co.kr/learn/courses/30/lessons/42861
아이디어
딱봐도 최소 스패닝 트리 같아서 풀었더니 바로 풀렸다!
최소 스패닝 트리를 쓰기 위해서는 유니온 파인드를 구현해야하는데
복잡하진 않지만, 코드량이 많아서 아주 귀찮다.
시간복잡도
O(E logV)
소스코드
심심해서 프로그래머스 Lv.3 도전했는데 바로 컷당했다. ㅋㅋㅋㅋㅋㅋㅋㅋㅋ
프로그래머스는 트리를 너무 좋아하는듯;;
Beta Was this translation helpful? Give feedback.
All reactions