上一页 1 2 3 4 5 6 7 ··· 12 下一页
摘要: 1 #!/usr/bin/env python 2 3 def find_the_max(ary): 4 max_val = 0 5 for i in range(len(ary)-1): 6 for j in range(len(ary[i])-1): 7 sum_val = ary[i][j] + ary[i+1][j]... 阅读全文
posted @ 2017-03-17 11:25 小黄人python 阅读(1014) 评论(0) 推荐(0) 编辑
摘要: 1 #!/usr/bin/env python 2 3 class Node(object): 4 def __init__(self,elem,next_=None): 5 self.elem = elem 6 self.next = next_ 7 8 class Simple_List(object): 9 def __... 阅读全文
posted @ 2017-03-17 10:53 小黄人python 阅读(426) 评论(0) 推荐(0) 编辑
摘要: http://www.jianshu.com/p/b34dbb643a70 阅读全文
posted @ 2017-03-16 15:00 小黄人python 阅读(6966) 评论(0) 推荐(0) 编辑
摘要: 以 http://www.cnblogs.com/0201zcr/p/4728241.html 为主 以 http://www.cnblogs.com/jyzhao/p/5001782.html 为参考 http://jingyan.baidu.com/article/15622f2410da70f 阅读全文
posted @ 2017-03-16 11:14 小黄人python 阅读(312) 评论(0) 推荐(0) 编辑
摘要: http://blog.sina.com.cn/s/blog_684848d60101hj8a.html 阅读全文
posted @ 2017-03-16 09:57 小黄人python 阅读(190) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/huxi/archive/2010/07/04/1771073.html 阅读全文
posted @ 2017-03-13 14:46 小黄人python 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2017-03-13 12:51 小黄人python 阅读(286) 评论(0) 推荐(0) 编辑
摘要: 转:http://hunkz.blog.51cto.com/6157447/1630369 阅读全文
posted @ 2017-03-09 14:23 小黄人python 阅读(993) 评论(0) 推荐(0) 编辑
摘要: 直接层次遍历是比较简单的,但是题目要求的分层打印,这就变得稍微有些麻烦 我是采用两个队列的方法实现。 1.将树结构入队列1。 2.当队列1和队列2都不为空的时候,则一直循环。 3.当队列1不为空的时候,就一直取出队列1中的元素,打印其根节点数据,然后将其子树存入队列2,直到队列1为空结束。 4.与3 阅读全文
posted @ 2017-03-08 21:12 小黄人python 阅读(268) 评论(0) 推荐(0) 编辑
摘要: 1 #!/usr/bin/env python 2 3 def pow1(n,m): 4 if m==0: return 1 5 if m==-1: return (1/n) 6 if m & 1 != 0: 7 return int(str(n * pow1(n, m-1)... 阅读全文
posted @ 2017-03-08 20:51 小黄人python 阅读(1124) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 12 下一页