Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit139b225

Browse files
committed
2017 8.30
1 parentc271662 commit139b225

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

‎Readme.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1445,14 +1445,18 @@ def coinChange(values,valuesCounts,money,coinsUsed):
14451445
```
14461446

14471447
思路:http://blog.csdn.net/wdxin1322/article/details/9501163
1448+
14481449
方法:http://www.cnblogs.com/ChenxofHit/archive/2011/03/18/1988431.html
14491450

14501451
##13 广度遍历和深度遍历二叉树
14511452

14521453
给定一个数组,构建二叉树,并且按层次打印这个二叉树
14531454

1454-
```python
1455+
14551456
##14 二叉树节点
1457+
1458+
```python
1459+
14561460
classNode(object):
14571461
def__init__(self,data,left=None,right=None):
14581462
self.data= data
@@ -1461,7 +1465,12 @@ class Node(object):
14611465

14621466
tree= Node(1, Node(3, Node(7, Node(0)), Node(6)), Node(2, Node(5), Node(4)))
14631467

1468+
```
1469+
14641470
##15 层次遍历
1471+
1472+
```python
1473+
14651474
deflookup(root):
14661475
stack= [root]
14671476
while stack:
@@ -1471,7 +1480,13 @@ def lookup(root):
14711480
stack.append(current.left)
14721481
if current.right:
14731482
stack.append(current.right)
1483+
1484+
```
1485+
14741486
##16 深度遍历
1487+
1488+
```python
1489+
14751490
defdeep(root):
14761491
ifnot root:
14771492
return

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp