摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
本博客不定期更新 LeetCode 题目总结,所有题目使用 Java 实现,前 400 题的部分题目也提供 JavaScript 代码。但是我想现如今你完全可以用任何 AI 工具把 Java 代码翻译成 JavaScript 或任何其他语言以达到学习的目的。我不追求一行 AC 但是我追求一题多解,比 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文