收藏強(qiáng)迫癥
這個(gè)就是資料~
1. 開著翻譯看教程拴还,實(shí)例教程郭膛,有分析有圖
https://pythonprogramming.net/
2. 用github看算法導(dǎo)論
3. Jupyter Notebook版的Tensorflow教程
https://github.com/sjchoi86/Tensorflow-101
4. Deep Learning Tutorials電腦帶不動(dòng),就先留著嘍
https://github.com/sjchoi86/Deep-Learning-101
無(wú)聊寫代碼
好好補(bǔ)補(bǔ)基礎(chǔ)熊杨,今天就是歸并沒并上來...反思一下寫代碼
# MergeSort 歸并
def mergeSort(arr):
mid = len(arr)/2
left ,right = arr[:mid],arr[mid:]
if len(left)>1:
left = mergeSort(left)
if len(right)>1:
right = mergeSort(right)
res = []
while left and right:
if left[0]>=right[0]:
res.append(left.pop())
else:
res.append(right.pop())
res.reverse()
return (left or right)+res
arr = [4,1,2,7,6]
print mergeSort(arr)
# 快排
def quickSort(arr):
if len(arr)<=1:return arr
low,pi,high = partition(arr)
return quickSort(low)+[pi]+quickSort(high)
# 分區(qū)
def partition(arr):
pi , arr = arr[0],arr[1:]
low = [x for x in arr if x<=pi]
high = [x for x in arr if x>pi]
return low,pi,high
print quickSort(arr)