- 博客(6)
- 收藏
- 关注
原创 445. Add Two Numbers II Python
You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contain a single digit. Add the two numbers and return i...
2018-04-26 16:18:35 287
原创 112. Path Sum Python
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Note: A leaf is a node with no children.Example:Give...
2018-04-25 17:15:34 128
原创 111. Minimum Depth of Binary Tree Python
Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.Note: A leaf is a node with no children.Ex...
2018-04-25 17:11:19 198
原创 Leetcode 804. Unique Morse Code Words python
International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follows: "a"maps to ".-", "b" maps to "-...", "c" maps to "-.-.", and so on.For
2018-04-12 18:12:52 381
原创 二叉树的实现,前,中,后,广遍历
class Node(object):#创建节点类型 def __init__(self,item): self.elem = item#节点的值 self.lchild = None#左节点 self.rchild = None#右节点class Tree(object): def __init__(self):#默认的根节点是...
2018-04-08 19:24:46 128
原创 看懂Python中的__init__,__call__,__getattr__
class test(): def __init__(self,name,age): self._name = name self._age = age def __call__(self): return 'return itself!' def __getattr__(self,item): if item == 'n...
2018-04-08 15:55:17 173
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人