摘要: 之前专门聊过令牌桶算法,而类似的方案还有布隆过滤器。它一般用于高效地查找一个元素是否在一个集合中。 用js实现如下所示: class BloomFilter { constructor(size, hashFunctions) { this.size = size; this.bitArray = 阅读全文
posted @ 2024-02-18 20:16 freephp 阅读(76) 评论(0) 推荐(0) 编辑