文章 2023-01-08 来自:开发者社区

LeetCode contest 190 5418. 二叉树中的伪回文路径 Pseudo-Palindromic Paths in a Binary Tree

LeetCode contest 190 5418. 二叉树中的伪回文路径 Pseudo-Palindromic Paths in a Binary TreeTable of Contents一、中文版二、英文版三、My answer四、解题报告一、中文版给你一棵二叉树,每个节点的值为 1 到 9 。我们称二叉树中的一条路径是 「伪回文」的,当它满足:路径经过的所有节点值的排列中,存在一个回文序....

LeetCode contest 190 5418. 二叉树中的伪回文路径 Pseudo-Palindromic Paths in a Binary Tree
文章 2023-01-08 来自:开发者社区

LeetCode 108. 将有序数组转换为二叉搜索树 Convert Sorted Array to Binary Search Tree

LeetCode 108. 将有序数组转换为二叉搜索树 Convert Sorted Array to Binary Search TreeTable of Contents一、中文版二、英文版三、My answer四、解题报告一、中文版将一个按照升序排列的有序数组,转换为一棵高度平衡二叉搜索树。本题中,一个高度平衡二叉树是指一个二叉树每个节点 的左右两个子树的高度差的绝对值不超过 1。示例:给....

文章 2023-01-07 来自:开发者社区

LeetCode 102. 二叉树的层序遍历 Binary Tree Level Order Traversal

LeetCode 102. 二叉树的层序遍历 Binary Tree Level Order TraversalTable of Contents一、中文版二、英文版三、My answer四、解题报告一、中文版给你一个二叉树,请你返回其按 层序遍历 得到的节点值。 (即逐层地,从左到右访问所有节点)。 示例:二叉树:[3,9,20,null,null,15,7],   &...

文章 2023-01-07 来自:开发者社区

LeetCode 104. 二叉树的最大深度 Maximum Depth of Binary Tree

LeetCode 104. 二叉树的最大深度 Maximum Depth of Binary TreeTable of Contents一、中文版二、英文版三、My answer四、解题报告一、中文版给定一个二叉树,找出其最大深度。二叉树的深度为根节点到最远叶子节点的最长路径上的节点数。说明: 叶子节点是指没有子节点的节点。示例:给定二叉树 [3,9,20,null,null,15,7], &am...

文章 2023-01-07 来自:开发者社区

LeetCode Contest 178-1367. 二叉树中的列表 Linked List in Binary Tree

LeetCode Contest 178-1367. 二叉树中的列表 Linked List in Binary Tree目录一、中文版二、英文版三、My answer四、解题报告一、中文版给你一棵以 root 为根的二叉树和一个 head 为第一个节点的链表。如果在二叉树中,存在一条一直向下的路径,且每个点的数值恰好一一对应以 head 为首的链表中每个节点的值,那么请你返回 True ,否则....

LeetCode Contest 178-1367. 二叉树中的列表 Linked List in Binary Tree
文章 2023-01-05 来自:开发者社区

LeetCode 401. Binary Watch

DescriptionA binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59).Each LED represents a zero or one, with the least significa....

LeetCode 401. Binary Watch
文章 2023-01-05 来自:开发者社区

LeetCode297. Serialize and Deserialize Binary Tree

DescriptionSerialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connectio....

LeetCode297. Serialize and Deserialize Binary Tree
文章 2023-01-05 来自:开发者社区

LeetCode 257. Binary Tree Paths

DescriptionGiven a binary tree, return all root-to-leaf paths.Note: A leaf is a node with no children.Example:Input: 1 / \ 2 3 \ 5 Output: ["1->2->5", "1->3"] Explanation: All r...

LeetCode 257. Binary Tree Paths
文章 2023-01-05 来自:开发者社区

LeetCode 110. Balanced Binary Tree

DescriptionGiven a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as:a binary tree in which the depth of the two subtrees of every node nev....

LeetCode 110. Balanced Binary Tree
文章 2023-01-05 来自:开发者社区

LeetCode 107. Binary Tree Level Order Traversal II

DescriptionGiven a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For example:Given binary tree [3,9,20,null,....

LeetCode 107. Binary Tree Level Order Traversal II

本页面内关键词为智能算法引擎基于机器学习所生成,如有任何问题,可在页面下方点击"联系我们"与我们沟通。

算法编程

开发者社区在线编程频道官方技术圈。包含算法资源更新,周赛动态,每日一题互动。

+关注