Tree

· 알고리즘
https://leetcode.com/problems/maximum-depth-of-binary-tree/ LeetCode - The World's Leading Online Programming Learning Platform 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 트리를 구현이 가능한지 불가능한지를 판단할 수 있는 기본 문제 제시해준 TreeNode를 사용하여 재귀함수로 풀이하였습니다. 우선 깊이는 1부터 시작하구요. (문제 예시를 보면 알 수 있음) 루트 노드를 기..
· 알고리즘
https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/ LeetCode - The World's Leading Online Programming Learning Platform 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 간단한 트리 문제, 가장 낮은 공통 조상 노드를 찾는 문제 조상 노드가 될 수 있는 경우의 수는 4가지 노드에 어떤 값도 들어오지 않았을 때 → 전달해줄 값이 없음 노드가 주어진 p 또는..
서연(linda)
'Tree' 태그의 글 목록