본문 바로가기
반응형

🖥️ 문제 풀이/리트코드(Leetcode)62

[LeetCode 해석 및 풀이] 235. Lowest Common Ancestor of a Binary Search Tree(이진 검색 트리의 최하위 공통 조상) LeetCode 문제 해석 및 풀이 방법문제 235. Lowest Common Ancestor of a Binary Search Tree(이진 검색 트리의 최하위 공통 조상)난이도 : 중간🟡 바로가기 문제 설명영문Given a binary search tree (BST), find the lowest common ancestor (LCA) node of two given nodes in the BST. According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descend.. 2024. 7. 24.
[LeetCode 해석 및 풀이] 572. Subtree of Another Tree (다른 트리의 서브트리) LeetCode 문제 해석 및 풀이 방법 문제 572. Subtree of Another Tree (다른 트리의 서브트리)바로가기 문제 설명영문Given the roots of two binary trees root and subRoot, return true if there is a subtree of root with the same structure and node values of subRoot and false otherwise. A subtree of a binary tree tree is a tree that consists of a node in tree and all of this node's descendants. The tree tree could also be considered a.. 2024. 7. 21.
[LeetCode 해석 및 풀이] 100. Same Tree (같은 트리) LeetCode 문제 해석 및 풀이 방법 문제 100. 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 same value. 한글두 개의 이진 트리의 뿌리 p, q가 주어졌을 때 두 개의 트리가 같은지 아닌지 체크하는 함수를 작성하시오, 두 개의 이진트리는 구조적으로 동일하고 노드가 동일한 값을 갖는 경우 동일한 것으로 간주됩니다. 제한조건The n.. 2024. 7. 19.
[LeetCode 해석 및 풀이] 110. Balanced Binary Tree (균형 잡힌 이진트리) LeetCode 문제 해석 및 풀이 방법 문제 110. Balanced Binary Tree (균형 잡힌 이진트리)바로가기 문제 설명영문Given a binary tree, determine if it is height-balanced A height-balanced binary tree is a binary tree in which the depth of the two subtrees of every node never differs by more than one. 한글이진 트리가 주어지면, 높이-균형이 잡혀있는지 결정하십시오 높이-균형 이진트리는 모든 노드의 자식 트리의 높이차가 1보다 크지 않는 트리를 뜻합니다. 제한조건The number of nodes in the tree is in the ra.. 2024. 7. 18.
[LeetCode 해석 및 풀이] 543. Diameter of Binary Tree (이진 트리에서의 지름) LeetCode 문제 해석 및 풀이 방법 문제 543. Diameter of Binary Tree (이진트리에서의 지름)바로가기 문제 설명영문Given the root of a binary tree, return the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path between any two nodes in a tree. This path may or may not pass through the root. The length of a path between two nodes is represented by the number of edges between them. 한글이.. 2024. 7. 18.
[LeetCode 해석 및 풀이] 104. Maximum Depth of Binary Tree(이진 트리의 최대 깊이) LeetCode 문제 해석 및 풀이 방법 문제 104. Maximum Depth of Binary Tree(이진 트리의 최대 깊이)바로가기 문제 설명영문Given the root of a binary tree, return its maximum depth. A binary tree's maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. 한글이진 트리의 root가 주어지면, 최대 깊이를 반환하십시오. 이진 트리의 최대 깊이는 root 노트로부터 가장 멀리 있는 노드까지의 경로에 있는 노드의 갯수입니다. 제한조건The number of nodes in the tr.. 2024. 7. 4.
반응형