알고리즘/그래프
![[트리] 리트코드(Leetcode)/2265 - Count Nodes Equal to Average of Subtree](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2Fc2DdBo%2FbtrLKJ7m9ry%2FAAAAAAAAAAAAAAAAAAAAAGYk6To2PwDE0wGpVDQ7uK6DdFJsjS-INuUWMBbdwmvX%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3D1oVm1LctVFEPUCR1FU7GRz9aoIA%253D)
[트리] 리트코드(Leetcode)/2265 - Count Nodes Equal to Average of Subtree
PROBLEM Count Nodes Equal to Average of Subtree - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com N = 서브트리의 합의 평균과 그 서브트리의 루트값과 같을 때를 카운트한 값 RETRY FLAG Y - 재귀에 대한 이해 다시 적립 필요 - 멍한 상태로 디버깅 하지말기 MY SOLUTION 아래는 전역변수로 관리하는 방식이고 마지막에 값이 들어가게 되는 최상단 루트인 4에서 node==null로 들어간 상태로 값을 돌려받는거라..
[트리] 리트코드(Leetcode)/1584 - Min Cost to Connect All Points
시행착오 최소 비용이라길래 BFS를 떠올림 두 점 사이의 거리를 뭔가 수학적으로 접근할 수 있을거란 생각을 함 BFS로 구현해보고자 2차원배열을 107 사이즈로 해당 좌표에 값을 채워넣는 초기화로 시작했으나 잘 안돼서 결국 힌트를 봄..ㅠㅠ