摘要: function HashTable() { this.storage = [] this.count = 0 this.limit = 7 // 哈希函数 HashTable.prototype.hashFunc = function (str,size) { var hashCode = ... 阅读全文
posted @ 2019-07-12 17:38 suanmei 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-07-12 16:55 suanmei 阅读(94) 评论(0) 推荐(0) 编辑
摘要: function Set() { // 属性 不用数组 因为数组允许元素重复 集合是不重复的 this.items = {} // 方法 Set.prototype.add = function(value) { if (this.has(value)) { //对象中已经有了该元素 不需要添加了 ... 阅读全文
posted @ 2019-07-12 11:41 suanmei 阅读(127) 评论(0) 推荐(0) 编辑