摘要: https://blog.csdn.net/wushaowu2014/article/details/94734203 阅读全文
posted @ 2019-08-15 16:49 lililili—— 阅读(300) 评论(0) 推荐(0)
摘要: 这道题的思路,和面试题39,56一致,我都牺牲了空间,也就是空间复杂度为O(n),时间复杂度为O(n) 但是显然这个思路不是最优的思路。 阅读全文
posted @ 2019-08-15 15:03 lililili—— 阅读(179) 评论(0) 推荐(0)
摘要: # -*- coding:utf-8 -*- # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None import copy class Solution: # 返回二维列表,内部每个列表表示找... 阅读全文
posted @ 2019-08-15 12:01 lililili—— 阅读(101) 评论(0) 推荐(0)
摘要: # -*- coding:utf-8 -*- class Solution: def VerifySquenceOfBST(self, sequence): # write code here # 先判断边界 if sequence == []: return False root = sequen... 阅读全文
posted @ 2019-08-15 11:05 lililili—— 阅读(195) 评论(0) 推荐(0)