摘要: A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge connecting them. A node can only appear i 阅读全文
posted @ 2020-03-18 14:34 CNoodle 阅读(430) 评论(0) 推荐(0) 编辑
摘要: 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-03-18 10:29 CNoodle 阅读(443) 评论(0) 推荐(0) 编辑
摘要: 本博客不定期更新 LeetCode 题目总结,所有题目使用 Java 实现,小部分题目也提供 JavaScript 代码。我不追求一行 AC 但是我追求一题多解,比较常规的思路,解释清楚复杂度,代码可读性强。欢迎留言和评论,共同进步。这本是我自己用来复习的笔记,如果也能帮到你,那也是我的福报。 如果 阅读全文
posted @ 2020-03-18 09:02 CNoodle 阅读(2588) 评论(2) 推荐(1) 编辑
摘要: Given the root of a binary tree, return the length of the longest path, where each node in the path has the same value. This path may or may not pass 阅读全文
posted @ 2020-03-18 06:19 CNoodle 阅读(197) 评论(0) 推荐(0) 编辑
摘要: Given the root of a binary tree, return the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path betwee 阅读全文
posted @ 2020-03-18 01:58 CNoodle 阅读(298) 评论(0) 推荐(0) 编辑