上一页 1 ··· 91 92 93 94 95 96 97 98 99 ··· 106 下一页
摘要: #需求: # 一个类 # 对象的属性 : 姓名 性别 年龄 部门 # 员工管理系统 # 内部转岗 python开发 - go开发 # 姓名 性别 年龄 新的部门 # A men 83 python # A men 85 go # 1000个员工 # 如果几个员工对象的姓名和性别相同,这是一个人 # 请对这1000个员工做去重 #用到了set的内层如何实现,先hash,如果hash值一样的... 阅读全文
posted @ 2018-08-02 21:21 小学弟- 阅读(111) 评论(0) 推荐(0) 编辑
摘要: python 内置方法 __int__, __str__, __repr__,__eq__,__hash__他们是必须有返回值得! __init__ ,__hash__ 返回整数 __str__, __repr__ 返回字符串 __eq__ 返回布尔值 阅读全文
posted @ 2018-08-02 20:01 小学弟- 阅读(115) 评论(0) 推荐(0) 编辑
摘要: #------面向对象------# (1)什么时候用面向对象 ----答:1.代码量大,功能多。2.处理比较复杂角色之间的关系 #------创建一个对象------# 类名() 实例化 __new__()创造了一个对象的空间,还可以做一些简单的初始化。 #------创建一个类-------# class Leiming 语法级别,Python解释器读到就会创建一个类 type 是所... 阅读全文
posted @ 2018-08-01 21:59 小学弟- 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 算法的核心就在这一句上了:p[i] = min(p[2*id-i], p[id] + id - i); #include #include #include #include #include #include #include #include #include #include #include #include #include using name... 阅读全文
posted @ 2018-08-01 14:04 小学弟- 阅读(129) 评论(0) 推荐(0) 编辑
摘要: Problem Description 给定两个字符串string1和string2,判断string2是否为string1的子串。 Input 输入包含多组数据,每组测试数据包含两行,第一行代表string1(长度小于1000000),第二行代表string2(长度小于1000000),string1和string2中保证不出现空格。 Output 对于每组输入数据,若string2是... 阅读全文
posted @ 2018-08-01 13:59 小学弟- 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 它的优点是:利用字符串的公共前缀来减少查询时间,最大限度地减少无谓的字符串比较,查询效率比哈希树高。 它有3个基本性质: 根节点不包含字符,除根节点外每一个节点都只包含一个字符; 从根节点到某一节点,路径上经过的字符连接起来,为该节点对应的字符串; 每个节点的所有子节点包含的字符都不相同。 #include #include #include using namespace std; ... 阅读全文
posted @ 2018-08-01 13:58 小学弟- 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 1、应尽量避免在 where 子句中使用!=或操作符,否则将引擎放弃使用索引而进行全表扫描。 2、对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。 3、应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索引而进行全表扫描。如: select id from t where num is null 可... 阅读全文
posted @ 2018-08-01 08:48 小学弟- 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 比如,斐波那契数列:1,1,2,3,5,8,13,21,34.... 用列表生成式写不出来,但是我们可以用函数把它打印出来: def fib(number): n, a, b = 0, 0, 1 while n 注意: ... 阅读全文
posted @ 2018-08-01 08:42 小学弟- 阅读(4813) 评论(0) 推荐(0) 编辑
摘要: class Teacher: OPERATE_DIC = [ ('创建课程', 'create_course'), ('创造学生', 'create_student'), ('创建课程', 'create_course'), ('查看学生信息', 'check_student_info'), ] def _... 阅读全文
posted @ 2018-08-01 08:07 小学弟- 阅读(120) 评论(0) 推荐(0) 编辑
摘要: [1], [1, 1], [1, 2, 1], [1, 3, 3, 1], [1, 4, 6, 4, 1], [1, 5, 10, 10, 5, 1], [1, 6, 15, 20, 15, 6, 1], [1, 7, 21, 35, 35, 21, 7, 1], [1, 8, 28, 56, 70, 56, 28, 8, 1], [1, 9, 36, 84, 126, 126, 84, 36,... 阅读全文
posted @ 2018-07-31 20:08 小学弟- 阅读(304) 评论(0) 推荐(0) 编辑
上一页 1 ··· 91 92 93 94 95 96 97 98 99 ··· 106 下一页