11 2024 档案

摘要:230.二叉搜索树中第k小的元素 /** * Definition for a binary tree node. * function TreeNode(val, left, right) { * this.val = (val undefined ? 0 : val) * this.left = 阅读全文
posted @ 2024-11-30 15:25 KooTeam 阅读(2) 评论(0) 推荐(0) 编辑
摘要:class TreeNode { constructor(val, left = null, right = null) { this.val = val; this.left = left; this.right = right; } } var isValidBST = function (ro 阅读全文
posted @ 2024-11-23 21:50 KooTeam 阅读(5) 评论(0) 推荐(0) 编辑
摘要:var maxDepth = function(root) { if(root null)return 0 let leftMax=1 let rightMax=1 if(root.left)leftMax=maxDepth(root.left)+1 if(root.right)rightMax=m 阅读全文
posted @ 2024-11-17 16:11 KooTeam 阅读(3) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示