数据结构
JayWang1994
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
<LeetCode>-Hash Table练习 (Python)
June 27, 2019 Two Sum <Easy> 题解一:Two-pass Hash Table 思路:目标是查找序列里符合条件的值的index,而Hash Table是映射数组里值和index的最好的方法,因此需使用Hash Table,使时间复杂度为O(1), 当发生碰撞时,时间复杂度为O(n). 步骤:使用两次迭代。(Runtime 40ms, Memory 1...原创 2019-06-28 11:04:49 · 638 阅读 · 0 评论 -
<LeetCode>-Tree 练习 (Python)
做题之前,先把preorder, inorder 和 postorder的recursive和iterative实现一遍。 前序遍历: 递归实现 # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None...原创 2019-07-05 10:55:13 · 519 阅读 · 0 评论
分享