[Codility] Tree Height 2024.02.18 15:25 ⭐ 코딩테스트/Codility [Codility] Tree Height 해결전략 이진트리 Binary Tree 정답코드 #include <algorithm> int answer; void DFS(tree* node, int currLength){ if(node == nullptr) return; answer = max(answer, currLength); if(node->l != nullptr){ DFS(node->l, currLength + 1); } if(node->r != nullptr){ DFS(node->r, currLength + 1); }} int solution(tree* T) { DFS(T, 0); return answer;} 유사문제 2024.02.18 - [⭐ 코딩테스트/Codility] - [Codility] Tree Longest Zigzag 좋아요공감공유하기 URL 복사카카오톡 공유페이스북 공유엑스 공유 게시글 관리 구독하기Designerd '⭐ 코딩테스트 > Codility' 카테고리의 다른 글 [Codility] Binary Gap (0) 2024.02.18 [Codility] Array Inversion Count (0) 2024.02.18 [Codility] Tree Longest Zigzag (0) 2024.02.18 [Codility] The Matrix (0) 2024.02.17 [Codility] FirstUnique (0) 2024.02.07 댓글 공유하기 다른 글 댓글 Designerd...구독하기 댓글을 사용할 수 없습니다. 이 글 공유하기 카카오톡 카카오톡 라인 라인 트위터 트위터 Facebook Facebook 카카오스토리 카카오스토리 밴드 밴드 네이버 블로그 네이버 블로그 Pocket Pocket Evernote Evernote 다른 글 [Codility] Binary Gap [Codility] Binary Gap 2024.02.18 [Codility] Array Inversion Count [Codility] Array Inversion Count 2024.02.18 [Codility] Tree Longest Zigzag [Codility] Tree Longest Zigzag 2024.02.18 [Codility] The Matrix [Codility] The Matrix 2024.02.17 다른 글 더 둘러보기
댓글을 사용할 수 없습니다.