package
0.0.0-20230424045628-a36dcc1d90e4
Repository: https://github.com/weedge/lib.git
Documentation: pkg.go.dev

# README

介绍

set 集合, 包括mapset , bitset(或者bitmap) , 这里的hashset是以mapset来实现;

使用场景

其实主要都是在 存在性 问题 场景下的解决方案,尽量以低的空间利用率来解决问题,比如:

  1. mapset 使用在某个元素是否已经在集合中了,map key是否存在;
  2. bitset 使用在多个集合的diff, 并,与,异或等运算,计算汉明重量,以及偏移运算场景, 以及对bitset进行压缩(roaringbitmap);
  3. Bitset 使用在类似0-1背包的问题,用于计算存放服用是否状态,进行状态转移,在高空间复杂度的情况下,优化内存消耗;
  4. 由bitset衍生的bloom filter 过滤器,用于不存在的场景;

Tips: go1.13 以及之后的版本才支持位运算编译

invalid operation: 1 << i (signed shift count type int) requires go1.13 or later (-lang was set to go1.12; check go.mod)

references

  1. https://github.com/deckarep/golang-set
  2. https://github.com/yourbasic/bit
  3. https://github.com/bits-and-blooms/bitset
  4. https://github.com/RoaringBitmap/roaring
  5. Consistently faster and smaller compressed bitmaps with Roaring.pdf
  6. An Experimental Study of Bitmap Compression vs. Inverted List Compression.pdf
  7. https://github.com/bits-and-blooms/bloom
  8. 扶苏的bitset浅谈

# Functions

创建BitSet.
No description provided by the author

# Structs

No description provided by the author
No description provided by the author

# Type aliases

Error is used to distinguish errors (panics) generated in this package.