自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

原创 应届生该如何找工作?

没有工作经验怎么办呢?还要求要会各种各样的技术。

2019-07-26 08:24:21 59 0

原创 搭建MySQL主从

搭建主从 #将主服务器的数据备份到从服务器上 **#好处:**1.读写分离,2.数据备份,3.负载均衡 #配置主从同步的基本步骤: 1.在主服务器上,必须开启二进制日志机制和配置一个独立的ip 2.在每一个从服务器上,配置一个唯一的id,创建一个用来专门复制主服务器数据的账号 3.在开始复制进程之...

2018-11-18 11:13:26 2800 0

原创 有道翻译——爬取

输入英文从有道翻译网址爬取js数据 #coding=utf-8 import urllib import urllib2 fanyi_url = 'http://fanyi.youdao.com/translate?smartresult=dict&smartresul...

2018-09-19 10:56:08 132 0

原创 用户输入关键字,爬取百度贴吧

爬取百度贴吧 #coding=utf-8 import urllib2 import urllib def loadPage(url, filename): ''' 作用:根据url发送请求, 获取服务器响应文件 url:需要...

2018-09-18 16:21:42 93 0

原创 binary search in Python

binary search def binary_search(list_02, item): n = len(list_02) if n >= 1: mid = n // 2 if list_02[mid] == item: ...

2018-08-27 16:59:50 318 0

原创 merge sort in Python

merge sort def merge_sort(list_02): n = len(list_02) if n <= 1: return list_02 mid = n // 2 left_li = merge_sort(li...

2018-08-27 16:19:55 502 0

原创 quick sort in Python

quick sort def quick_sort(list_02, first, last): if first >= last: return mid_val = list_02[first] low = first high...

2018-08-27 15:06:12 313 0

原创 shell sort in Python

shell sort def shell_sort(list_02): gap = len(list_02) // 2 while gap > 0: for i in range(gap, len(list_02)): w...

2018-08-26 16:57:07 130 0

原创 insert sort in Python

insert sort def insert_sort(list_02): for j in range(1, len(list_02)): for i in range(j, 0, -1): if list_02[i] < li...

2018-08-26 16:55:43 207 0

原创 Selection sort in Python

Selection sort def selection_sort(list_02): for j in range(len(list_02) - 1): min_index = j for i in range(j + 1, len(list_02)...

2018-08-25 14:11:41 243 0

原创 Bubble sort in Pyton

Bubble sort def bubble_sort(list_02): for j in range(len(list_02) - 1, 0, -1): count = 0 for i in range(0, j): if ...

2018-08-25 13:31:31 81 0

原创 Queue in Python

Queue class Queue(): '''Queue''' def __init__(self): self.__list = [] def enqueue(self, item): ...

2018-08-25 10:58:49 128 0

原创 Deque in Python

Deque class Queue(): '''Queue''' def __init__(self): self.__list = [] def enqueue(self, item): ...

2018-08-25 10:56:23 120 0

原创 Stack in Python

Stack class Stack(): '''stack''' def __init__(self): self.__list = [] def push(self, item): ...

2018-08-25 10:33:43 95 0

原创 Double Link List

Double Link List class Node(object): '''this is a node''' def __init__(self, elem): self.elem = elem...

2018-08-25 10:07:53 467 0

原创 Single Circular Link List in Python

Single Circular Link List class Node(object): '''this is a node''' def __init__(self, elem): self.el...

2018-08-25 10:06:04 58 0

原创 Single Link List in Python

Single Link List class Node(object): '''this is a node''' def __init__(self, elem): self.elem = elem...

2018-08-25 10:02:22 230 0

原创 Remove duplicate list in Python

Method one def distinct(list_1): list_2 = set(list_1) list_3 = list(list_2) print(list_3) def main(): list_1 = [1,1,6,3,1,5,2] ...

2018-08-22 08:34:42 270 0

原创 __getattrinute__ in Python

Method of restricting attribute access class GetAttribute(): def __init__(self, name): self.name = name def __getattribute__...

2018-08-21 11:02:48 53 0

原创 File copy in Python

File copy # Copy data function def copyData(old_file, new_file): while True: fileData = old_file.read(1024) if len(fileData) =...

2018-08-17 21:43:41 84 0

原创 Swap the values of 2 variables in Python

Swap the values of 2 variables # Requirements: Swap the values of a and b def main(): a = 5 b = 4 print('a = %d, b = %d'%(a,...

2018-08-16 20:39:36 74 0

原创 python_Notes

Notes # : Single-Line Comments ”’ multiline comment ”’ #coding=utf-8 #in python2, this sentence must be added to the beginning,otherwise will ...

2018-08-16 15:26:19 50 0

提示
确定要删除当前文章?
取消 删除