上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 77 下一页
摘要: Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest l 阅读全文
posted @ 2020-05-30 23:20 苗妙苗 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. N 阅读全文
posted @ 2020-05-30 10:38 苗妙苗 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 还是一样的,在中序中找出那个众数存一下次数 主函数看谁的value最大 可以用map,是哦! https://leetcode.com/problems/find-mode-in-binary-search-tree/discuss/98103/Java-AC-Solution 阅读全文
posted @ 2020-05-30 09:31 苗妙苗 阅读(118) 评论(0) 推荐(0) 编辑
摘要: Given 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 lef 阅读全文
posted @ 2020-05-30 08:42 苗妙苗 阅读(177) 评论(0) 推荐(0) 编辑
摘要: Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a 阅读全文
posted @ 2020-05-26 09:35 苗妙苗 阅读(99) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path betwe 阅读全文
posted @ 2020-05-26 05:50 苗妙苗 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia 阅读全文
posted @ 2020-05-25 22:11 苗妙苗 阅读(100) 评论(0) 推荐(0) 编辑
摘要: Given 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"] 阅读全文
posted @ 2020-05-25 10:43 苗妙苗 阅读(110) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is symmet 阅读全文
posted @ 2020-05-24 22:07 苗妙苗 阅读(97) 评论(0) 推荐(0) 编辑
摘要: Find the sum of all left leaves in a given binary tree. Example: 3 / \ 9 20 / \ 15 7 There are two left leaves in the binary tree, with values 9 and 1 阅读全文
posted @ 2020-05-24 10:48 苗妙苗 阅读(106) 评论(0) 推荐(0) 编辑
上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 77 下一页