会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
mess4u
新随笔
联系
订阅
管理
上一页
1
2
3
4
下一页
2014年7月16日
#Leet Code# Binary Tree Max[待精简]
摘要: 描述:递归调用,getMax返回 [节点值,经过节点左子节点的最大值,经过节点右节点的最大值],每次递归同时查看是否存在不经过节点的值大于max。代码:待优化 1 def getLargeNode(self, a, b): 2 if a and b: 3 ...
阅读全文
posted @ 2014-07-16 18:42 mess4u
阅读(101)
评论(0)
推荐(0)
2014年7月15日
#Leet Code# Divide Two Integers
摘要: 描述:不使用 * / % 完成除法操作。O(n)复杂度会超时,需要O(lg(n))复杂度。代码: 1 class Solution: 2 # @return an integer 3 def dividePositive(self, dividend, divisor): 4 ...
阅读全文
posted @ 2014-07-15 14:06 mess4u
阅读(125)
评论(0)
推荐(0)
2014年7月10日
#Leet Code# Root to leaf
摘要: 语言:Python描述:使用递归实现 1 def getList(self, node): 2 if node is None: 3 return [] 4 5 if node.left is None and node.right ...
阅读全文
posted @ 2014-07-10 15:06 mess4u
阅读(201)
评论(0)
推荐(0)
2014年7月9日
#Leet Code# Unique Tree
摘要: 语言:Python描述:使用递归实现 1 class Solution: 2 # @return an integer 3 def numTrees(self, n): 4 if n == 0: 5 return 0 6 eli...
阅读全文
posted @ 2014-07-09 09:47 mess4u
阅读(134)
评论(0)
推荐(0)
2014年7月7日
#Leet Code# Same Tree
摘要: 语言:Python描述:使用递归实现 1 # Definition for a binary tree node 2 # class TreeNode: 3 # def __init__(self, x): 4 # self.val = x 5 # self...
阅读全文
posted @ 2014-07-07 17:30 mess4u
阅读(177)
评论(0)
推荐(0)
2014年6月26日
#TOOLS# Cmder & ...
摘要: Cmder
阅读全文
posted @ 2014-06-26 11:31 mess4u
阅读(108)
评论(0)
推荐(0)
#Leet Code# LRU Cache
摘要: 语言:C++描述:使用单链表实现,HeadNode是key=-1,value=-1,next=NULL的结点。距离HeadNode近的结点是使用频度最小的Node。 1 struct Node { 2 int key; 3 int value; 4 Node* next; 5...
阅读全文
posted @ 2014-06-26 11:26 mess4u
阅读(135)
评论(0)
推荐(0)
2014年5月26日
linux make
摘要: todo
阅读全文
posted @ 2014-05-26 15:28 mess4u
阅读(87)
评论(0)
推荐(0)
编译过程
摘要: -o obj-l link(todo)
阅读全文
posted @ 2014-05-26 13:46 mess4u
阅读(72)
评论(0)
推荐(0)
2014年5月19日
强弱类型 静态语言 动态语言 || 脚本语言
摘要: 强类型变量一旦声明 类型不能改变 强类型不支持以下 弱类型支持1 + '2'静态语言 变量需要提前声明 动态语言不需要静态语言 C++int a = 3;a += 1;动态语言 Pythona = 3a += 1动态语言 -- 运行时可以改变结构 新的函数、对象、代码可以被引进,已有的函数可以被删除...
阅读全文
posted @ 2014-05-19 11:15 mess4u
阅读(291)
评论(0)
推荐(0)
上一页
1
2
3
4
下一页
公告