leetcode.cn 2023-09-04
🟡449.serialize-and-deserialize-bst
🏷️ Tags
#tree #depth_first_search #breadth_first_search #design #binary_search_tree #string #binary_tree
🟡449.serialize-and-deserialize-bst
🏷️ Tags
#tree #depth_first_search #breadth_first_search #design #binary_search_tree #string #binary_tree
Telegraph
serialize-and-deserialize-bst
序列化是将数据结构或对象转换为一系列位的过程,以便它可以存储在文件或内存缓冲区中,或通过网络连接链路传输,以便稍后在同一个或另一个计算机环境中重建。 设计一个算法来序列化和反序列化 二叉搜索树 。 对序列化/反序列化算法的工作方式没有限制。 您只需确保二叉搜索树可以序列化为字符串,并且可以将该字符串反序列化为最初的二叉搜索树。 编码的字符串应尽可能紧凑。 示例 1: 输入:root = [2,1,3] 输出:[2,1,3] 示例 2: 输入:root = [] 输出:[] 提示:
leetcode.com 2023-11-01
🟢501.find-mode-in-binary-search-tree
🏷️ Tags
#tree #depth_first_search #binary_search_tree #binary_tree
🟢501.find-mode-in-binary-search-tree
🏷️ Tags
#tree #depth_first_search #binary_search_tree #binary_tree
Telegraph
find-mode-in-binary-search-tree
Given the root of a binary search tree (BST) with duplicates, return all the mode(s) (i.e., the most frequently occurred element) in it. If the tree has more than one mode, return them in any order. Assume a BST is defined as follows:
👍1
leetcode.cn 2023-12-04
🟡1038.binary-search-tree-to-greater-sum-tree
🏷️ Tags
#tree #depth_first_search #binary_search_tree #binary_tree
🟡1038.binary-search-tree-to-greater-sum-tree
🏷️ Tags
#tree #depth_first_search #binary_search_tree #binary_tree
Telegraph
binary-search-tree-to-greater-sum-tree
给定一个二叉搜索树 root (BST),请将它的每个节点的值替换成树中大于或者等于该节点值的所有节点值之和。 提醒一下, 二叉搜索树 满足下列约束条件:
leetcode.com 2024-01-08
🟢938.range-sum-of-bst
🏷️ Tags
#tree #depth_first_search #binary_search_tree #binary_tree
🟢938.range-sum-of-bst
🏷️ Tags
#tree #depth_first_search #binary_search_tree #binary_tree
Telegraph
range-sum-of-bst
Given the root node of a binary search tree and two integers low and high, return the sum of values of all nodes with a value in the inclusive range [low, high]. Example 1: Input: root = [10,5,15,3,7,null,18], low = 7, high = 15 Output: 32 Explanation:…