摘要:
本节主要讨论九大排序算法,排序对数据结构中一个最重要的部分,同时也是后面数据结构的基础所有必须要先有所理解: 排序分为内部排序和外部排序两种,内部排序是数据记录在内存进行的排序,外部排序是由于数据量太大,不得不采取的措施,排序过程中需要访问外部内存。 对于数据量N 很大时,不得不采用时间复杂度o(n
阅读全文
posted @ 2016-10-26 18:55
上后谈爱情
阅读(155)
推荐(0)
编辑
摘要:
异常即是一个事件,会影响程序的正常运行,运行中的错误,采用try/except语句检查
阅读全文
posted @ 2016-10-23 10:15
上后谈爱情
阅读(176)
推荐(0)
编辑
摘要:
1.tile(A,res)将数组进行重复,tile(Matrix,(m,n)),将其扩展成任一行 2.shape[0] 数组的第维维数, 3.sum(axis=0)将数组对应的列相加,axis=1,对应的行进行相加 4.argsort(x,axis=0)将数组X进行按列升序排序,x换为-x表示按列降
阅读全文
posted @ 2016-10-23 10:14
上后谈爱情
阅读(1415)
推荐(0)
编辑
摘要:
1.使用xpath从html文档得到其中元素: <a href="www.abidu.com">123we</a>为了得到其中的123we元素 tree=html.fromstring(***.text) tt=list(set(tree.xpath("//a[@href='www.abidu.co
阅读全文
posted @ 2016-10-23 10:14
上后谈爱情
阅读(577)
推荐(0)
编辑
摘要:
1.不使用锁的话,可能会产生线程的竞争:当共享一个对象(变量或者一个方法)加锁的操作 在threading模块中,定义两种类型的琐:threading.Lock和threading.RLock。它们之间有一点细微的区别,通过比较下面两段代码来说明:import threading lock = th
阅读全文
posted @ 2016-10-23 10:12
上后谈爱情
阅读(623)
推荐(0)
编辑
摘要:
anagram 相同字母异序词。heart vs earth 1.Our first solution to the anagram problem will check to see that each character in the first string actually occurs i
阅读全文
posted @ 2016-10-23 10:08
上后谈爱情
阅读(475)
推荐(0)
编辑
摘要:
二.python中面向对象过程中:定义类(对类的知识的理解) 2.1 A Fraction Class:a built-in classes to show examples of data and control structures.从python的内嵌的内部类中链接python的定义类的过程,
阅读全文
posted @ 2016-10-22 20:48
上后谈爱情
阅读(248)
推荐(0)
编辑
摘要:
1.8.1 Built-in Atomic Data Types Python has two main built-in numeric classes(内置函数,int 和 float) that implement the integer and floating point data typ
阅读全文
posted @ 2016-10-22 16:49
上后谈爱情
阅读(276)
推荐(0)
编辑
摘要:
1.在模拟登陆的过程中第一步需要得到登陆前信息,用户名和密码通过js预先加密,所以必须要先将js预先加密的servertime和nonce和pubkey得到,下面json模块和re得到预先加密的信息 1 # coding:utf-8 2 import urllib2 3 import re 4 im
阅读全文
posted @ 2016-09-03 20:04
上后谈爱情
阅读(685)
推荐(1)
编辑
摘要:
3.采用beatifulsoup与re正则表达式一起使,提取html中的一些href的链接 http://cuiqingcai.com/1319.html 4.如何利用正则表达式边界匹配
阅读全文
posted @ 2016-09-03 19:50
上后谈爱情
阅读(520)
推荐(0)
编辑