原创 python寫算法題:leetcode: 108. Convert Sorted Array to Binary Search Tree
class Solution(object): def sortedArrayToBST(self, nums): """ :type nums: List[int] :rtyp
原创 python寫算法題:leetcode: 105. Construct Binary Tree from Preorder and Inorder Traversal
class Solution(object): def constructTree(self, preorder, inorder, indMap, preind0, preind1, inind0, inind1):
原创 python寫算法題:leetcode: 106. Construct Binary Tree from Inorder and Postorder Traversal
class Solution(object): def constructTree(self, inorder, postorder, indMap, inind0, inind1, postind0, postind1):
原创 python寫算法題:leetcode: 99. Recover Binary Search Tree
class Solution(object): def checkOrder(self, node, checkNode, dsc): if checkNode[0]!=None: return
原创 python寫算法題:leetcode: 110. Balanced Binary Tree
class Solution(object): def deep(self, root): if root==None: return 0 return max(self.deep(root.le
原创 python寫算法題:leetcode: 102. Binary Tree Level Order Traversal
class Solution(object): def traversal(self, node, ret, level): if node==None: return if len(ret)<
原创 python寫算法題:leetcode: 103. Binary Tree Zigzag Level Order Traversal
class Solution(object): def traversal(self, node, ret, level): if node==None: return if len(ret)<
原创 python寫算法題:leetcode: 100. Same Tree
class Solution(object): def isSameTree(self, p, q): if (p==None and q==None): return True if (p==
原创 解決華爲手機EMUI 9之後,GMS無法使用問題
chrome,goolgle play,youtube 這幾個經常用的app,在我某一天升級我的華爲手機到emui9之後突然用不了了,一直試圖解決,找了一堆gms安裝器,都不好使。又不想破解boot loader,不願重刷系統。於是此後裝
原创 python寫算法題:leetcode: 98. Validate Binary Search Tree
class Solution(object): def min(self, node): if node==None: return None if 'minv' in
原创 python寫算法題:leetcode: 97. Interleaving String
class Solution(object): def isInterleave(self, s1, s2, s3): """ :type s1: str :type s2: s
原创 python寫算法題:leetcode: 96. Unique Binary Search Trees
class Solution(object): def numTrees(self, n): """ :type n: int :rtype: int """
原创 python寫算法題:leetcode: 95. Unique Binary Search Trees II
class Solution(object): def _gen(self, cache, start, end): if start>end: return [None,]
原创 python寫算法題:leetcode: 92. Reverse Linked List II
class Solution(object): def reverseBetween(self, head, m, n): """ :type head: ListNode :ty
原创 python寫算法題:leetcode: 94. Binary Tree Inorder Traversal
class Solution(object): def inorderTraversal(self, root): """ :type root: TreeNode :rtype