随笔分类 -  算法(Go)

加油,fighting,算法不能停
摘要:用bit位来构建集合,查找插入重复数据效率都非常高。 type IntSet struct { words []uint64 } // Has reports whether the set contains the non-negative value x. func (s *IntSet) Ha 阅读全文
posted @ 2020-10-28 16:57 LeeJuly 阅读(110) 评论(0) 推荐(0) 编辑
摘要:归并排序 package main import ( "fmt" ) func mergeSort(low, high int, a *[]int) { if low >= high { return } mid := (low + high) / 2 mergeSort(low, mid, a) 阅读全文
posted @ 2020-08-05 10:48 LeeJuly 阅读(78) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示