摘要: 4.1 package main import ( "crypto/sha256" "fmt" ) func popCount(b [32]byte) (res int) { for _, v := range b { n := int(v) for n > 0 { n = n & (n - 1) 阅读全文
posted @ 2019-02-20 18:38 zerofl-diary 阅读(626) 评论(0) 推荐(0) 编辑
摘要: 递归分类查询所有子类,包含子类的子类。 阅读全文
posted @ 2019-01-25 20:12 zerofl-diary 阅读(977) 评论(1) 推荐(0) 编辑
摘要: 7.1:使用类似ByteCounter的想法,实现单词和行的计数器,实现时考虑使用bufio.ScanWords。 package main import ( "bufio" "fmt" ) type WordsCounter int func (c *WordsCounter) Write(con 阅读全文
posted @ 2019-01-20 14:54 zerofl-diary 阅读(1586) 评论(0) 推荐(0) 编辑
摘要: 1.在centos7容器内编译安装php,并构建自定义扩展; 2.在php7容器内构建自定义扩展。 阅读全文
posted @ 2019-01-15 16:03 zerofl-diary 阅读(302) 评论(0) 推荐(0) 编辑
摘要: Yii2设计模式初步学习,尝试通过Yii2框架自身的实现帮助理解部分设计模式。 阅读全文
posted @ 2018-09-16 21:59 zerofl-diary 阅读(388) 评论(0) 推荐(0) 编辑
摘要: 第一份工作bug总结 阅读全文
posted @ 2018-08-28 16:58 zerofl-diary 阅读(581) 评论(0) 推荐(0) 编辑
摘要: 用php实现自顶向下与自底向上归并排序算法,并基于自顶向下归并排序思想求解逆序对数目。 阅读全文
posted @ 2018-08-01 16:00 zerofl-diary 阅读(835) 评论(0) 推荐(0) 编辑
摘要: 在典型层次分类表中查询某个节点及其所有父级节点。 阅读全文
posted @ 2018-07-24 16:06 zerofl-diary 阅读(7525) 评论(2) 推荐(0) 编辑
摘要: 总结一下学习的复杂度为O(n^2)的三种排序算法:选择排序,插入排序,希尔排序。 (1)选择排序:从第一个位置开始每次查找剩下的位置中最小的数值放入当前位置; (2)插入排序:从第二个位置开始,每次都将当前位置的数值插入前面合适的位置,对于几乎有序的数列来说,插入排序能带来更高的效率; (3)希尔排 阅读全文
posted @ 2018-07-12 18:11 zerofl-diary 阅读(247) 评论(0) 推荐(0) 编辑
摘要: 最近学习算法,先来总结一下复杂度为O(nlog(n))的快速排序,用js封装了一个quickSort对象,提供六种快速排序方法: (1)单路快排:递归版,非递归版; (2)双路快排:递归版,非递归版; (3)三路快排:递归版,非递归版。 阅读全文
posted @ 2018-07-11 13:55 zerofl-diary 阅读(255) 评论(0) 推荐(0) 编辑