前面讲的是比较排序算法,主要有冒泡排序,选择排序,插入排序,归并排序,堆排序,快速排序等。 非比较排序算法:计数排序,基数排序,桶排序。在一定条件下,它们的时间复杂度可以达到O(n)。 一,计数排序(Counting Sort) (1)算法简介 计数排序(Counting sort)是一种稳定的排序 ...
分类:
编程语言 时间:
2018-06-08 00:51:06
阅读次数:
245
ThinkPHP5的模型是一种对象-关系映射(Object / Relation Mapping ,简称 ORM)的封装,并且提供了简洁的ActiveRecord实现。一般来说,每个数据表会和一个“模型”对应。 ThinkPHP5 模型类和Db类的区别主要在于对象的封装,Db类的查询默认返回的是数组 ...
分类:
其他好文 时间:
2018-06-08 00:34:16
阅读次数:
313
原文: https://www.cnblogs.com/chenguangliang/p/5856701.html js模块化编程之彻底弄懂CommonJS和AMD/CMD! 先回答我:为什么模块很重要? 答:因为有了模块,我们就可以更方便地使用别人的代码,想要什么功能,就加载什么模块。但是,这样做 ...
分类:
Web程序 时间:
2018-06-08 00:32:22
阅读次数:
235
#include<iostream> using namespace std; class Pack { public: void plus(); Pack(int a,int b):m(a),n(b){} ~Pack(){} int getm(){return m;} int getn(){ret ...
分类:
其他好文 时间:
2018-06-07 23:00:21
阅读次数:
181
Week 2 History: The First Internet NSFNet Welcome to week 2! This week, we’ll be covering the history of the first internet: NSFnet. In the 1960s and ...
分类:
Web程序 时间:
2018-06-07 22:55:54
阅读次数:
269
1 # 有向无环图 2 def sortedTopology(graph): 3 inDict = {} # 存储节点:节点入度 4 zeroInQueue = Queue() # 存储入度为零的节点 5 for node in graph.nodes: # 遍历图所有的节点 6 ... ...
分类:
编程语言 时间:
2018-06-07 22:00:47
阅读次数:
239
一、分支管理 git branch #查看分支 git branch aming #创建分支 git checkout aming #切换分支到aming下 git checkout master;git merge aming #合并分支aming到master 同时对两个分支进行不同的修改,内容 ...
分类:
其他好文 时间:
2018-06-07 20:53:05
阅读次数:
189
A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child. Input Each input file contain ...
分类:
其他好文 时间:
2018-06-07 20:47:43
阅读次数:
197
原因: 这个错误的原因是高版本mysql(客户服务器版本5..7.18)默认的sql_mode包含ONLY_FULL_GROUP_BY,这个属性保证了select到的列都在group by中出现. 查看SQL_MODE的语句如下: 解决方案: 方法一.可以使用SQL语句暂时修改SQL_MODE,重启 ...
分类:
数据库 时间:
2018-06-07 20:10:56
阅读次数:
708