摘要: import numpy as npimport cv2from scipy import ndimagek33=np.array([[-1,-1,-1], [-1,8,-1], [-1,-1,-1]])k... 阅读全文
posted @ 2018-06-29 11:11 luoganttcc 阅读(257) 评论(0) 推荐(0) 编辑
摘要: import numpy as npimport cv2from scipy import ndimagek33=np.array([[-1,-1,-1], [-1,8,-1], [-1,-1,-1]])k... 阅读全文
posted @ 2018-06-29 11:00 luoganttcc 阅读(132) 评论(0) 推荐(0) 编辑
摘要: import tensorflow as tf #导入tensorflowa=tf.constant([[1,2]]) #定义了一个1×2的矩阵b=tf.constant([[2], [4]]) #定义了一个2×1的... 阅读全文
posted @ 2018-06-28 22:59 luoganttcc 阅读(67) 评论(0) 推荐(0) 编辑
摘要: 文章1文章2 阅读全文
posted @ 2018-06-28 22:48 luoganttcc 阅读(59) 评论(0) 推荐(0) 编辑
摘要: a=[5,4,2,3,1]print(a)n=len(a)l=0r=n-1while True: if a[l]>a[r]: a[l],a[r]=a[r],a[l] r=r-1 if l==r: l=l+1 ... 阅读全文
posted @ 2018-06-27 11:47 luoganttcc 阅读(78) 评论(0) 推荐(0) 编辑
摘要: import heapq#-*- coding: UTF-8 -*-import numpy as npdef MakeHeap(a): for i in range(int(a.size / 2) - 1, -1, -1):#对非叶子节点的子节点进行... 阅读全文
posted @ 2018-06-27 10:43 luoganttcc 阅读(135) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python3# -*- coding: utf-8 -*-"""Created on Tue Jun 26 22:32:27 2018@author: luogan"""class Node(object): def _... 阅读全文
posted @ 2018-06-27 09:49 luoganttcc 阅读(303) 评论(0) 推荐(0) 编辑
摘要: 我确定很多人不能真正的理解二叉树……class Node: def __init__(self,value=0,left=0,right=0): self.value=value self.left=left ... 阅读全文
posted @ 2018-06-26 22:30 luoganttcc 阅读(307) 评论(0) 推荐(0) 编辑
摘要: class Student(object): def __init__(self, name, score): self.name = name self.score = scorest=Student('lg',99)pr... 阅读全文
posted @ 2018-06-26 13:45 luoganttcc 阅读(86) 评论(0) 推荐(0) 编辑
摘要: nums = [3,1,2]n=len(nums)for i in range(n-1): for j in range(n-i-1): if nums[j]>nums[j+1]: nums[j+1],nums[j]... 阅读全文
posted @ 2018-06-26 13:42 luoganttcc 阅读(76) 评论(0) 推荐(0) 编辑