brotherhoodhzy
brotherhoodhzy
全部文章
分类
题解(3)
归档
标签
去牛客网
登录
/
注册
brotherhoodhzy的博客
全部文章
(共3篇)
题解 | #二叉搜索树的第k个结点#python 解法
其实考的就是中序遍历。 要注意检查pRoot,k(特别是k值) def KthNode(self, pRoot, k): # write code here # 按大小顺序输出所有节点的值( 即是中序遍历) # idx取出所求的值, 返回。 ...
2021-08-11
0
322
题解 | #平衡二叉树#python 解法
先求高度, 再判断平衡。 我都是用的递归做, 感觉这题可以作为中等 class Solution: flag = True def IsBalanced_Solution(self, pRoot): dict_h = {} dict_h[None] =...
2021-08-11
0
324
题解 | #数组中重复的数字#python 解法
python 解法 # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param numbers int整型一维数组 # @return int整型 # class Solution: def duplicate(self , numbers )...
2021-08-10
0
296