tree
LeetCode / Tree / 1161번 / Maximum Level Sum of a Binary Tree / JS
Maximum Level Sum of a Binary Tree - LeetCode Can you solve this real interview question? Maximum Level Sum of a Binary Tree - Given the root of a binary tree, the level of its root is 1, the level of its children is 2, and so on. Return the smallest level x such that the sum of all the values of node leetcode.com 트리에서 각 층을 이루는 노드들의 합을 구했을 때, 그 합이 가장 큰 층이 몇 층인지 반환하는 문제이다...
LeetCode / Tree / 530번 / Minimum Absolute Difference in BST / JS
Minimum Absolute Difference in BST - LeetCode Can you solve this real interview question? Minimum Absolute Difference in BST - Given the root of a Binary Search Tree (BST), return the minimum absolute difference between the values of any two different nodes in the tree. Example 1: [https://assets.l leetcode.com BST(Binary Search Tree)를 이루는 모든 노드들 중에서 2개의 노드를 뽑아 뺐을 때, 가장 작..
LeetCode / Tree / 199번 / Binary Tree Right Side View / JS
Binary Tree Right Side View - LeetCode Can you solve this real interview question? Binary Tree Right Side View - Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. Example 1: [https://asse leetcode.com 주어진 트리에서 각 depth(layer) 마다의 가장 오른쪽 노드만 모아서 반환하는 문제이다. /** * Definiti..
LeetCode / Tree / 101번 / Symmetric Tree / JS
Symmetric Tree - LeetCode Can you solve this real interview question? Symmetric Tree - Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center). Example 1: [https://assets.leetcode.com/uploads/2021/02/19/symtree1.jpg] Input: roo leetcode.com 주어진 트리가 좌우대칭을 이루는지 판별하여 boolean 값을 반환하는 문제이다. /** * Definition for a binary tree ..
LeetCode / Tree / 100번 / Same Tree / JS
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 주어진 두 트리가 구조적으로 같은 트리인지 판단해서 boolean 값을 반환하는 문제이다. /** * Definition for a binary tre..
LeetCode / Tree / 437번 / Path Sum III / JS
Path Sum III - LeetCode Can you solve this real interview question? Path Sum III - Given the root of a binary tree and an integer targetSum, return the number of paths where the sum of the values along the path equals targetSum. The path does not need to start or end at the roo leetcode.com 주어진 트리내에서 targetSum을 만족하는 subtree가 몇개가 존재하는지 반환하는 문제이다. /** * Definition for a bin..