LeetCode知识点总结 – 783

LeetCode 783. Minimum Distance Between BST Nodes
考点难度TreeEasy
题目
Given the root of a Binary Search Tree (BST), return the minimum difference between the values of any two different nodes in the tree.
思路
和530题一样。
答案
class Solution {
int min = Integer.MAX_VALUE;
Integer prev = null;

public int minDiffInBST(TreeNode root) {
if (root == null) return min;

minDiffInBS

LeetCode知识点总结 – 783最先出现在Python成神之路

版权声明:
作者:dingding
链接:https://www.techfm.club/p/11869.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>