leetcode 230. Kth Smallest Element in a BST
来源:互联网 发布:改视频的软件 编辑:程序博客网 时间:2024/06/05 20:33
class Solution(object): def __init__(self): self.sequence = list() def kthSmallest(self, root, k): """ :type root: TreeNode :type k: int :rtype: int """ self.inorder_travelsal(root,k) return self.sequence[-1] def inorder_travelsal(self,root,k): if not root or len(self.sequence) ==k: return self.inorder_travelsal(root.left,k) if len(self.sequence) != k: self.sequence.append(root.val) self.inorder_travelsal(root.right,k)
阅读全文
0 0
- #leetcode#Kth Smallest Element in a BST
- leetcode--Kth Smallest Element in a BST
- Leetcode|Kth Smallest Element in a BST
- [leetcode] Kth Smallest Element in a BST
- 【LeetCode】Kth Smallest Element in a BST
- LeetCode Kth Smallest Element in a BST
- 【leetcode】Kth Smallest Element in a BST
- LeetCode Kth Smallest Element in a BST
- leetcode: Kth Smallest Element in a BST
- Leetcode: Kth Smallest Element in a BST
- [LeetCode] Kth Smallest Element in a BST
- [LeetCode]Kth Smallest Element in a BST
- [Leetcode]Kth Smallest Element in a BST
- leetcode--Kth Smallest Element in a BST
- 【leetcode】Kth Smallest Element in a BST
- [leetcode] Kth Smallest Element in a BST
- [Leetcode]Kth Smallest Element in a BST
- Leetcode: Kth Smallest Element in a BST
- 1.mini.MenuButton 菜单按钮。
- Nginx最大处理连接数
- curl安装——windows
- deque双向队列
- 题目12:喷水装置(二)
- leetcode 230. Kth Smallest Element in a BST
- Java8 之 Lambda
- C++调用构造函数
- ZOJ 1119 SPF(割点)
- eclipse使用maven打包可执行的jar包
- 前端插件之-swiper
- 如何使用windows的计划任务?
- 透明三角的两种设置方式
- android 三方微信登录,分享 坑