목록이진트리 (13)
넘치게 채우기
https://leetcode.com/problems/same-tree/description/ Same Tree - LeetCode Can you solve this real interview question? Same Tree - Given the roots of two binary trees p and q, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally identical, and the nodes have the leetcode.com LeetCode - Same Tree 문제 유형 : 트리, 탐색 문제 난이도 : Easy 문제 Gi..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/cQPSCr/btsDbeGutEr/LpwUTCFuJLTtxY93pjVTF1/img.png)
https://leetcode.com/problems/leaf-similar-trees/description/ Leaf-Similar Trees - LeetCode Can you solve this real interview question? Leaf-Similar Trees - Consider all the leaves of a binary tree, from left to right order, the values of those leaves form a leaf value sequence. [https://s3-lc-upload.s3.amazonaws.com/uploads/2018/07/16/tree.png leetcode.com leetcode - Lear-Similar Trees 문제 유형 : ..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bixTCH/btrQI630AJO/9Zi1vLrP7kMPToIbFuOzsk/img.png)
트리는 계층적 관계를 표현하는 자료 구조이다. 뿌리에서 가지를 늘려가며 뻗어가는 모양을 그리는 완전 그래프여서 트리라고 부른다. 회사의 조직도나, 컴퓨터 폴더의 구조에서 트리를 볼 수 있다. 용어 정리 ·노드 node 트리의 구성요소가 되는 정점(A, B, C, D, E, F) ·간선 edge 노드와 노드를 연결하는 연결선 ·루트 root 트리의 최상위 노드(A). 나무의 뿌리와 같은 위치에 있어서 이름이 루트이다. ·단말 노드 terminal node 아래로 또 다른 노드가 연결되어있지 않은 노드이다. 나무의 구조상 잎의 위치여서 잎사귀 노드(leaf node)라고도 한다. ·내부 노드 internal node 단말 노드를 제외한 모든 노드, 비단말 노드(nonterminal node)라고 한다. ·부..