[Leetcode] 98. Validate Binary Search Tree - 문제풀이 Description 주어진 이진트리가 유효한 이진탐색트리인지 여부를 반환하는 문제입니다. Given the root of a binary tree, determine if it is a valid binary search tree (BST). A valid BST is defined as follows: The left subtree of a node contains only nodes with keys less than the node's key. The right subtree of a node contains only nodes with keys greater than the node's key. Both the left and right subtrees must also be binary sea.. 알고리즘/LeetCode 2022. 2. 14. 13:45
[LeetCode] 701. Insert into a Binary Search Tree - 문제풀이 Description 주어진 이진 검색 트리에서 특정 값을 올바른 노드에 삽입 후 root를 반환하는 문제입니다. You are given the root node of a binary search tree (BST) and a value to insert into the tree. Return the root node of the BST after the insertion. It is guaranteed that the new value does not exist in the original BST. Notice that there may exist multiple valid ways for the insertion, as long as the tree remains a BST after inserti.. 알고리즘/LeetCode 2022. 2. 14. 13:12