data-structure-typed 1.34.7 → 1.34.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +1 -0
- package/CHANGELOG.md +1 -1
- package/CONTRIBUTING.md +0 -0
- package/README.md +8 -8
- package/dist/data-structures/binary-tree/aa-tree.js +2 -5
- package/dist/data-structures/binary-tree/aa-tree.js.map +1 -1
- package/dist/data-structures/binary-tree/abstract-binary-tree.js +314 -457
- package/dist/data-structures/binary-tree/abstract-binary-tree.js.map +1 -1
- package/dist/data-structures/binary-tree/avl-tree.js +64 -90
- package/dist/data-structures/binary-tree/avl-tree.js.map +1 -1
- package/dist/data-structures/binary-tree/b-tree.js +2 -5
- package/dist/data-structures/binary-tree/b-tree.js.map +1 -1
- package/dist/data-structures/binary-tree/binary-indexed-tree.js +17 -22
- package/dist/data-structures/binary-tree/binary-indexed-tree.js.map +1 -1
- package/dist/data-structures/binary-tree/binary-tree.js +12 -31
- package/dist/data-structures/binary-tree/binary-tree.js.map +1 -1
- package/dist/data-structures/binary-tree/bst.js +157 -244
- package/dist/data-structures/binary-tree/bst.js.map +1 -1
- package/dist/data-structures/binary-tree/rb-tree.js +20 -44
- package/dist/data-structures/binary-tree/rb-tree.js.map +1 -1
- package/dist/data-structures/binary-tree/segment-tree.js +80 -122
- package/dist/data-structures/binary-tree/segment-tree.js.map +1 -1
- package/dist/data-structures/binary-tree/splay-tree.js +2 -5
- package/dist/data-structures/binary-tree/splay-tree.js.map +1 -1
- package/dist/data-structures/binary-tree/tree-multiset.js +168 -239
- package/dist/data-structures/binary-tree/tree-multiset.js.map +1 -1
- package/dist/data-structures/binary-tree/two-three-tree.js +2 -5
- package/dist/data-structures/binary-tree/two-three-tree.js.map +1 -1
- package/dist/data-structures/graph/abstract-graph.js +351 -585
- package/dist/data-structures/graph/abstract-graph.js.map +1 -1
- package/dist/data-structures/graph/directed-graph.js +152 -282
- package/dist/data-structures/graph/directed-graph.js.map +1 -1
- package/dist/data-structures/graph/map-graph.js +47 -88
- package/dist/data-structures/graph/map-graph.js.map +1 -1
- package/dist/data-structures/graph/undirected-graph.js +91 -180
- package/dist/data-structures/graph/undirected-graph.js.map +1 -1
- package/dist/data-structures/hash/coordinate-map.js +23 -45
- package/dist/data-structures/hash/coordinate-map.js.map +1 -1
- package/dist/data-structures/hash/coordinate-set.js +20 -42
- package/dist/data-structures/hash/coordinate-set.js.map +1 -1
- package/dist/data-structures/hash/hash-map.js +85 -247
- package/dist/data-structures/hash/hash-map.js.map +1 -1
- package/dist/data-structures/hash/hash-table.js +87 -128
- package/dist/data-structures/hash/hash-table.js.map +1 -1
- package/dist/data-structures/hash/pair.js +2 -5
- package/dist/data-structures/hash/pair.js.map +1 -1
- package/dist/data-structures/hash/tree-map.js +2 -5
- package/dist/data-structures/hash/tree-map.js.map +1 -1
- package/dist/data-structures/hash/tree-set.js +2 -5
- package/dist/data-structures/hash/tree-set.js.map +1 -1
- package/dist/data-structures/heap/heap.js +56 -80
- package/dist/data-structures/heap/heap.js.map +1 -1
- package/dist/data-structures/heap/max-heap.js +8 -26
- package/dist/data-structures/heap/max-heap.js.map +1 -1
- package/dist/data-structures/heap/min-heap.js +8 -26
- package/dist/data-structures/heap/min-heap.js.map +1 -1
- package/dist/data-structures/linked-list/doubly-linked-list.js +149 -218
- package/dist/data-structures/linked-list/doubly-linked-list.js.map +1 -1
- package/dist/data-structures/linked-list/singly-linked-list.js +119 -218
- package/dist/data-structures/linked-list/singly-linked-list.js.map +1 -1
- package/dist/data-structures/linked-list/skip-linked-list.js +50 -70
- package/dist/data-structures/linked-list/skip-linked-list.js.map +1 -1
- package/dist/data-structures/matrix/matrix.js +7 -8
- package/dist/data-structures/matrix/matrix.js.map +1 -1
- package/dist/data-structures/matrix/matrix2d.js +57 -70
- package/dist/data-structures/matrix/matrix2d.js.map +1 -1
- package/dist/data-structures/matrix/navigator.js +18 -37
- package/dist/data-structures/matrix/navigator.js.map +1 -1
- package/dist/data-structures/matrix/vector2d.js +63 -84
- package/dist/data-structures/matrix/vector2d.js.map +1 -1
- package/dist/data-structures/priority-queue/max-priority-queue.js +13 -41
- package/dist/data-structures/priority-queue/max-priority-queue.js.map +1 -1
- package/dist/data-structures/priority-queue/min-priority-queue.js +13 -41
- package/dist/data-structures/priority-queue/min-priority-queue.js.map +1 -1
- package/dist/data-structures/priority-queue/priority-queue.js +93 -139
- package/dist/data-structures/priority-queue/priority-queue.js.map +1 -1
- package/dist/data-structures/queue/deque.js +82 -128
- package/dist/data-structures/queue/deque.js.map +1 -1
- package/dist/data-structures/queue/queue.js +57 -157
- package/dist/data-structures/queue/queue.js.map +1 -1
- package/dist/data-structures/stack/stack.js +21 -22
- package/dist/data-structures/stack/stack.js.map +1 -1
- package/dist/data-structures/tree/tree.js +33 -46
- package/dist/data-structures/tree/tree.js.map +1 -1
- package/dist/data-structures/trie/trie.js +93 -200
- package/dist/data-structures/trie/trie.js.map +1 -1
- package/dist/types/data-structures/abstract-binary-tree.js.map +1 -1
- package/dist/utils/utils.js +22 -107
- package/dist/utils/utils.js.map +1 -1
- package/lib/data-structures/binary-tree/abstract-binary-tree.d.ts +124 -123
- package/lib/data-structures/binary-tree/abstract-binary-tree.js +136 -216
- package/lib/data-structures/binary-tree/avl-tree.d.ts +19 -10
- package/lib/data-structures/binary-tree/avl-tree.js +35 -13
- package/lib/data-structures/binary-tree/binary-tree.d.ts +6 -6
- package/lib/data-structures/binary-tree/binary-tree.js +7 -7
- package/lib/data-structures/binary-tree/bst.d.ts +34 -34
- package/lib/data-structures/binary-tree/bst.js +86 -89
- package/lib/data-structures/binary-tree/rb-tree.d.ts +3 -3
- package/lib/data-structures/binary-tree/rb-tree.js +4 -4
- package/lib/data-structures/binary-tree/tree-multiset.d.ts +40 -42
- package/lib/data-structures/binary-tree/tree-multiset.js +76 -86
- package/lib/data-structures/graph/abstract-graph.d.ts +62 -62
- package/lib/data-structures/graph/abstract-graph.js +86 -86
- package/lib/data-structures/graph/directed-graph.d.ts +51 -51
- package/lib/data-structures/graph/directed-graph.js +63 -63
- package/lib/data-structures/graph/map-graph.d.ts +13 -13
- package/lib/data-structures/graph/map-graph.js +12 -12
- package/lib/data-structures/graph/undirected-graph.d.ts +30 -30
- package/lib/data-structures/graph/undirected-graph.js +32 -32
- package/lib/data-structures/priority-queue/priority-queue.d.ts +3 -3
- package/lib/data-structures/priority-queue/priority-queue.js +3 -3
- package/lib/data-structures/tree/tree.d.ts +4 -4
- package/lib/data-structures/tree/tree.js +6 -6
- package/lib/interfaces/abstract-binary-tree.d.ts +37 -42
- package/lib/interfaces/abstract-graph.d.ts +13 -13
- package/lib/interfaces/avl-tree.d.ts +6 -4
- package/lib/interfaces/bst.d.ts +10 -9
- package/lib/interfaces/directed-graph.d.ts +5 -5
- package/lib/interfaces/rb-tree.d.ts +2 -2
- package/lib/interfaces/undirected-graph.d.ts +2 -2
- package/lib/types/data-structures/abstract-binary-tree.d.ts +3 -3
- package/lib/types/data-structures/abstract-binary-tree.js +0 -1
- package/lib/types/data-structures/abstract-graph.d.ts +2 -2
- package/lib/types/data-structures/bst.d.ts +2 -2
- package/lib/types/data-structures/tree-multiset.d.ts +1 -1
- package/lib/types/utils/validate-type.d.ts +8 -8
- package/package.json +6 -6
- package/scripts/rename_clear_files.sh +29 -0
- package/src/data-structures/binary-tree/abstract-binary-tree.ts +241 -293
- package/src/data-structures/binary-tree/avl-tree.ts +43 -14
- package/src/data-structures/binary-tree/binary-tree.ts +8 -8
- package/src/data-structures/binary-tree/bst.ts +101 -96
- package/src/data-structures/binary-tree/rb-tree.ts +9 -9
- package/src/data-structures/binary-tree/tree-multiset.ts +82 -94
- package/src/data-structures/graph/abstract-graph.ts +114 -109
- package/src/data-structures/graph/directed-graph.ts +77 -77
- package/src/data-structures/graph/map-graph.ts +20 -15
- package/src/data-structures/graph/undirected-graph.ts +39 -39
- package/src/data-structures/priority-queue/priority-queue.ts +3 -3
- package/src/data-structures/tree/tree.ts +7 -7
- package/src/interfaces/abstract-binary-tree.ts +37 -50
- package/src/interfaces/abstract-graph.ts +13 -13
- package/src/interfaces/avl-tree.ts +6 -4
- package/src/interfaces/bst.ts +9 -9
- package/src/interfaces/directed-graph.ts +5 -5
- package/src/interfaces/rb-tree.ts +2 -2
- package/src/interfaces/undirected-graph.ts +2 -2
- package/src/types/data-structures/abstract-binary-tree.ts +3 -4
- package/src/types/data-structures/abstract-graph.ts +2 -2
- package/src/types/data-structures/bst.ts +2 -2
- package/src/types/data-structures/tree-multiset.ts +1 -1
- package/src/types/utils/validate-type.ts +10 -10
- package/test/integration/avl-tree.test.ts +24 -24
- package/test/integration/bst.test.ts +71 -71
- package/test/unit/data-structures/binary-tree/avl-tree.test.ts +28 -28
- package/test/unit/data-structures/binary-tree/binary-tree.test.ts +4 -12
- package/test/unit/data-structures/binary-tree/bst.test.ts +79 -79
- package/test/unit/data-structures/binary-tree/overall.test.ts +20 -20
- package/test/unit/data-structures/binary-tree/tree-multiset.test.ts +80 -80
- package/test/unit/data-structures/graph/directed-graph.test.ts +8 -8
- package/test/unit/data-structures/graph/map-graph.test.ts +4 -4
- package/test/unit/data-structures/graph/overall.test.ts +2 -2
- package/test/unit/data-structures/graph/undirected-graph.test.ts +1 -1
- package/test/unit/data-structures/priority-queue/priority-queue.test.ts +4 -5
- package/test/unit/data-structures/tree/tree.test.ts +2 -2
- package/umd/bundle.min.js +1 -1
- package/umd/bundle.min.js.map +1 -1
|
@@ -1,53 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.CoordinateMap = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
_this._joint = '_';
|
|
4
|
+
class CoordinateMap extends Map {
|
|
5
|
+
constructor(joint) {
|
|
6
|
+
super();
|
|
7
|
+
this._joint = '_';
|
|
24
8
|
if (joint !== undefined)
|
|
25
|
-
|
|
26
|
-
return _this;
|
|
9
|
+
this._joint = joint;
|
|
27
10
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
CoordinateMap.prototype.delete = function (key) {
|
|
45
|
-
return _super.prototype.delete.call(this, key.join(this._joint));
|
|
46
|
-
};
|
|
47
|
-
CoordinateMap.prototype._setJoint = function (v) {
|
|
11
|
+
get joint() {
|
|
12
|
+
return this._joint;
|
|
13
|
+
}
|
|
14
|
+
has(key) {
|
|
15
|
+
return super.has(key.join(this._joint));
|
|
16
|
+
}
|
|
17
|
+
set(key, value) {
|
|
18
|
+
return super.set(key.join(this._joint), value);
|
|
19
|
+
}
|
|
20
|
+
get(key) {
|
|
21
|
+
return super.get(key.join(this._joint));
|
|
22
|
+
}
|
|
23
|
+
delete(key) {
|
|
24
|
+
return super.delete(key.join(this._joint));
|
|
25
|
+
}
|
|
26
|
+
_setJoint(v) {
|
|
48
27
|
this._joint = v;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
}(Map));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
52
30
|
exports.CoordinateMap = CoordinateMap;
|
|
53
31
|
//# sourceMappingURL=coordinate-map.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordinate-map.js","sourceRoot":"","sources":["../../../src/data-structures/hash/coordinate-map.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"coordinate-map.js","sourceRoot":"","sources":["../../../src/data-structures/hash/coordinate-map.ts"],"names":[],"mappings":";;;AAOA,MAAa,aAAiB,SAAQ,GAAW;IAC/C,YAAY,KAAc;QACxB,KAAK,EAAE,CAAC;QAIA,WAAM,GAAG,GAAG,CAAC;QAHrB,IAAI,KAAK,KAAK,SAAS;YAAE,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IAC/C,CAAC;IAID,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IASQ,GAAG,CAAC,GAAa;QACxB,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1C,CAAC;IAUQ,GAAG,CAAC,GAAa,EAAE,KAAQ;QAClC,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,CAAC;IACjD,CAAC;IAQQ,GAAG,CAAC,GAAa;QACxB,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1C,CAAC;IASQ,MAAM,CAAC,GAAa;QAC3B,OAAO,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7C,CAAC;IAES,SAAS,CAAC,CAAS;QAC3B,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAClB,CAAC;CACF;AA3DD,sCA2DC"}
|
|
@@ -1,50 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.CoordinateSet = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
_this._joint = '_';
|
|
4
|
+
class CoordinateSet extends Set {
|
|
5
|
+
constructor(joint) {
|
|
6
|
+
super();
|
|
7
|
+
this._joint = '_';
|
|
24
8
|
if (joint !== undefined)
|
|
25
|
-
|
|
26
|
-
return _this;
|
|
9
|
+
this._joint = joint;
|
|
27
10
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
CoordinateSet.prototype.delete = function (value) {
|
|
42
|
-
return _super.prototype.delete.call(this, value.join(this._joint));
|
|
43
|
-
};
|
|
44
|
-
CoordinateSet.prototype._setJoint = function (v) {
|
|
11
|
+
get joint() {
|
|
12
|
+
return this._joint;
|
|
13
|
+
}
|
|
14
|
+
has(value) {
|
|
15
|
+
return super.has(value.join(this._joint));
|
|
16
|
+
}
|
|
17
|
+
add(value) {
|
|
18
|
+
return super.add(value.join(this._joint));
|
|
19
|
+
}
|
|
20
|
+
delete(value) {
|
|
21
|
+
return super.delete(value.join(this._joint));
|
|
22
|
+
}
|
|
23
|
+
_setJoint(v) {
|
|
45
24
|
this._joint = v;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
}(Set));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
49
27
|
exports.CoordinateSet = CoordinateSet;
|
|
50
28
|
//# sourceMappingURL=coordinate-set.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordinate-set.js","sourceRoot":"","sources":["../../../src/data-structures/hash/coordinate-set.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"coordinate-set.js","sourceRoot":"","sources":["../../../src/data-structures/hash/coordinate-set.ts"],"names":[],"mappings":";;;AAOA,MAAa,aAAc,SAAQ,GAAQ;IACzC,YAAY,KAAc;QACxB,KAAK,EAAE,CAAC;QAIA,WAAM,GAAG,GAAG,CAAC;QAHrB,IAAI,KAAK,KAAK,SAAS;YAAE,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IAC/C,CAAC;IAID,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IASQ,GAAG,CAAC,KAAe;QAC1B,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5C,CAAC;IASQ,GAAG,CAAC,KAAe;QAC1B,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5C,CAAC;IASQ,MAAM,CAAC,KAAe;QAC7B,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/C,CAAC;IAES,SAAS,CAAC,CAAS;QAC3B,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAClB,CAAC;CACF;AAhDD,sCAgDC"}
|
|
@@ -1,65 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
8
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
9
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
10
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
11
|
-
switch (op[0]) {
|
|
12
|
-
case 0: case 1: t = op; break;
|
|
13
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
14
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
15
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
16
|
-
default:
|
|
17
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
18
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
19
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
20
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
21
|
-
if (t[2]) _.ops.pop();
|
|
22
|
-
_.trys.pop(); continue;
|
|
23
|
-
}
|
|
24
|
-
op = body.call(thisArg, _);
|
|
25
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
26
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HashMap = void 0;
|
|
4
|
+
class HashMap {
|
|
5
|
+
get hashFn() {
|
|
6
|
+
return this._hashFn;
|
|
27
7
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
31
|
-
if (m) return m.call(o);
|
|
32
|
-
if (o && typeof o.length === "number") return {
|
|
33
|
-
next: function () {
|
|
34
|
-
if (o && i >= o.length) o = void 0;
|
|
35
|
-
return { value: o && o[i++], done: !o };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
39
|
-
};
|
|
40
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
41
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
42
|
-
if (!m) return o;
|
|
43
|
-
var i = m.call(o), r, ar = [], e;
|
|
44
|
-
try {
|
|
45
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
+
set hashFn(value) {
|
|
9
|
+
this._hashFn = value;
|
|
46
10
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
try {
|
|
50
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
51
|
-
}
|
|
52
|
-
finally { if (e) throw e.error; }
|
|
11
|
+
get table() {
|
|
12
|
+
return this._table;
|
|
53
13
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
14
|
+
set table(value) {
|
|
15
|
+
this._table = value;
|
|
16
|
+
}
|
|
17
|
+
get capacityMultiplier() {
|
|
18
|
+
return this._capacityMultiplier;
|
|
19
|
+
}
|
|
20
|
+
set capacityMultiplier(value) {
|
|
21
|
+
this._capacityMultiplier = value;
|
|
22
|
+
}
|
|
23
|
+
get loadFactor() {
|
|
24
|
+
return this._loadFactor;
|
|
25
|
+
}
|
|
26
|
+
set loadFactor(value) {
|
|
27
|
+
this._loadFactor = value;
|
|
28
|
+
}
|
|
29
|
+
get initialCapacity() {
|
|
30
|
+
return this._initialCapacity;
|
|
31
|
+
}
|
|
32
|
+
set initialCapacity(value) {
|
|
33
|
+
this._initialCapacity = value;
|
|
34
|
+
}
|
|
35
|
+
get size() {
|
|
36
|
+
return this._size;
|
|
37
|
+
}
|
|
38
|
+
set size(value) {
|
|
39
|
+
this._size = value;
|
|
40
|
+
}
|
|
41
|
+
constructor(initialCapacity = 16, loadFactor = 0.75, hashFn) {
|
|
63
42
|
this._initialCapacity = initialCapacity;
|
|
64
43
|
this._loadFactor = loadFactor;
|
|
65
44
|
this._capacityMultiplier = 2;
|
|
@@ -67,124 +46,43 @@ var HashMap = (function () {
|
|
|
67
46
|
this._table = new Array(initialCapacity);
|
|
68
47
|
this._hashFn =
|
|
69
48
|
hashFn ||
|
|
70
|
-
(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
for (
|
|
49
|
+
((key) => {
|
|
50
|
+
const strKey = String(key);
|
|
51
|
+
let hash = 0;
|
|
52
|
+
for (let i = 0; i < strKey.length; i++) {
|
|
74
53
|
hash += strKey.charCodeAt(i);
|
|
75
54
|
}
|
|
76
|
-
return hash %
|
|
55
|
+
return hash % this.table.length;
|
|
77
56
|
});
|
|
78
57
|
}
|
|
79
|
-
|
|
80
|
-
get: function () {
|
|
81
|
-
return this._hashFn;
|
|
82
|
-
},
|
|
83
|
-
set: function (value) {
|
|
84
|
-
this._hashFn = value;
|
|
85
|
-
},
|
|
86
|
-
enumerable: false,
|
|
87
|
-
configurable: true
|
|
88
|
-
});
|
|
89
|
-
Object.defineProperty(HashMap.prototype, "table", {
|
|
90
|
-
get: function () {
|
|
91
|
-
return this._table;
|
|
92
|
-
},
|
|
93
|
-
set: function (value) {
|
|
94
|
-
this._table = value;
|
|
95
|
-
},
|
|
96
|
-
enumerable: false,
|
|
97
|
-
configurable: true
|
|
98
|
-
});
|
|
99
|
-
Object.defineProperty(HashMap.prototype, "capacityMultiplier", {
|
|
100
|
-
get: function () {
|
|
101
|
-
return this._capacityMultiplier;
|
|
102
|
-
},
|
|
103
|
-
set: function (value) {
|
|
104
|
-
this._capacityMultiplier = value;
|
|
105
|
-
},
|
|
106
|
-
enumerable: false,
|
|
107
|
-
configurable: true
|
|
108
|
-
});
|
|
109
|
-
Object.defineProperty(HashMap.prototype, "loadFactor", {
|
|
110
|
-
get: function () {
|
|
111
|
-
return this._loadFactor;
|
|
112
|
-
},
|
|
113
|
-
set: function (value) {
|
|
114
|
-
this._loadFactor = value;
|
|
115
|
-
},
|
|
116
|
-
enumerable: false,
|
|
117
|
-
configurable: true
|
|
118
|
-
});
|
|
119
|
-
Object.defineProperty(HashMap.prototype, "initialCapacity", {
|
|
120
|
-
get: function () {
|
|
121
|
-
return this._initialCapacity;
|
|
122
|
-
},
|
|
123
|
-
set: function (value) {
|
|
124
|
-
this._initialCapacity = value;
|
|
125
|
-
},
|
|
126
|
-
enumerable: false,
|
|
127
|
-
configurable: true
|
|
128
|
-
});
|
|
129
|
-
Object.defineProperty(HashMap.prototype, "size", {
|
|
130
|
-
get: function () {
|
|
131
|
-
return this._size;
|
|
132
|
-
},
|
|
133
|
-
set: function (value) {
|
|
134
|
-
this._size = value;
|
|
135
|
-
},
|
|
136
|
-
enumerable: false,
|
|
137
|
-
configurable: true
|
|
138
|
-
});
|
|
139
|
-
HashMap.prototype._hash = function (key) {
|
|
58
|
+
_hash(key) {
|
|
140
59
|
return this._hashFn(key);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
for (var bucket_1 = (e_2 = void 0, __values(bucket)), bucket_1_1 = bucket_1.next(); !bucket_1_1.done; bucket_1_1 = bucket_1.next()) {
|
|
151
|
-
var _e = __read(bucket_1_1.value, 2), key = _e[0], value = _e[1];
|
|
152
|
-
var newIndex = this._hash(key) % newCapacity;
|
|
153
|
-
if (!newTable[newIndex]) {
|
|
154
|
-
newTable[newIndex] = [];
|
|
155
|
-
}
|
|
156
|
-
newTable[newIndex].push([key, value]);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
160
|
-
finally {
|
|
161
|
-
try {
|
|
162
|
-
if (bucket_1_1 && !bucket_1_1.done && (_b = bucket_1.return)) _b.call(bucket_1);
|
|
163
|
-
}
|
|
164
|
-
finally { if (e_2) throw e_2.error; }
|
|
60
|
+
}
|
|
61
|
+
resizeTable(newCapacity) {
|
|
62
|
+
const newTable = new Array(newCapacity);
|
|
63
|
+
for (const bucket of this._table) {
|
|
64
|
+
if (bucket) {
|
|
65
|
+
for (const [key, value] of bucket) {
|
|
66
|
+
const newIndex = this._hash(key) % newCapacity;
|
|
67
|
+
if (!newTable[newIndex]) {
|
|
68
|
+
newTable[newIndex] = [];
|
|
165
69
|
}
|
|
70
|
+
newTable[newIndex].push([key, value]);
|
|
166
71
|
}
|
|
167
72
|
}
|
|
168
73
|
}
|
|
169
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
170
|
-
finally {
|
|
171
|
-
try {
|
|
172
|
-
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
173
|
-
}
|
|
174
|
-
finally { if (e_1) throw e_1.error; }
|
|
175
|
-
}
|
|
176
74
|
this._table = newTable;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
|
|
75
|
+
}
|
|
76
|
+
set(key, value) {
|
|
77
|
+
const loadFactor = this.size / this.table.length;
|
|
180
78
|
if (loadFactor >= this.loadFactor) {
|
|
181
79
|
this.resizeTable(this.table.length * this.capacityMultiplier);
|
|
182
80
|
}
|
|
183
|
-
|
|
81
|
+
const index = this._hash(key);
|
|
184
82
|
if (!this.table[index]) {
|
|
185
83
|
this.table[index] = [];
|
|
186
84
|
}
|
|
187
|
-
for (
|
|
85
|
+
for (let i = 0; i < this.table[index].length; i++) {
|
|
188
86
|
if (this.table[index][i][0] === key) {
|
|
189
87
|
this.table[index][i][1] = value;
|
|
190
88
|
return;
|
|
@@ -192,115 +90,55 @@ var HashMap = (function () {
|
|
|
192
90
|
}
|
|
193
91
|
this.table[index].push([key, value]);
|
|
194
92
|
this.size++;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
var index = this._hash(key);
|
|
93
|
+
}
|
|
94
|
+
get(key) {
|
|
95
|
+
const index = this._hash(key);
|
|
199
96
|
if (!this.table[index]) {
|
|
200
97
|
return undefined;
|
|
201
98
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
if (k === key) {
|
|
206
|
-
return v;
|
|
207
|
-
}
|
|
99
|
+
for (const [k, v] of this.table[index]) {
|
|
100
|
+
if (k === key) {
|
|
101
|
+
return v;
|
|
208
102
|
}
|
|
209
103
|
}
|
|
210
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
211
|
-
finally {
|
|
212
|
-
try {
|
|
213
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
214
|
-
}
|
|
215
|
-
finally { if (e_3) throw e_3.error; }
|
|
216
|
-
}
|
|
217
104
|
return undefined;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
|
|
105
|
+
}
|
|
106
|
+
remove(key) {
|
|
107
|
+
const index = this._hash(key);
|
|
221
108
|
if (!this.table[index]) {
|
|
222
109
|
return;
|
|
223
110
|
}
|
|
224
|
-
for (
|
|
111
|
+
for (let i = 0; i < this.table[index].length; i++) {
|
|
225
112
|
if (this.table[index][i][0] === key) {
|
|
226
113
|
this.table[index].splice(i, 1);
|
|
227
114
|
this.size--;
|
|
228
|
-
|
|
115
|
+
const loadFactor = this.size / this.table.length;
|
|
229
116
|
if (loadFactor < this.loadFactor / this.capacityMultiplier) {
|
|
230
117
|
this.resizeTable(this.table.length / this.capacityMultiplier);
|
|
231
118
|
}
|
|
232
119
|
return;
|
|
233
120
|
}
|
|
234
121
|
}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
_f.trys.push([0, 11, 12, 13]);
|
|
243
|
-
_a = __values(this.table), _b = _a.next();
|
|
244
|
-
_f.label = 1;
|
|
245
|
-
case 1:
|
|
246
|
-
if (!!_b.done) return [3, 10];
|
|
247
|
-
bucket = _b.value;
|
|
248
|
-
if (!bucket) return [3, 9];
|
|
249
|
-
_f.label = 2;
|
|
250
|
-
case 2:
|
|
251
|
-
_f.trys.push([2, 7, 8, 9]);
|
|
252
|
-
bucket_2 = (e_4 = void 0, __values(bucket)), bucket_2_1 = bucket_2.next();
|
|
253
|
-
_f.label = 3;
|
|
254
|
-
case 3:
|
|
255
|
-
if (!!bucket_2_1.done) return [3, 6];
|
|
256
|
-
_c = __read(bucket_2_1.value, 2), key = _c[0], value = _c[1];
|
|
257
|
-
return [4, [key, value]];
|
|
258
|
-
case 4:
|
|
259
|
-
_f.sent();
|
|
260
|
-
_f.label = 5;
|
|
261
|
-
case 5:
|
|
262
|
-
bucket_2_1 = bucket_2.next();
|
|
263
|
-
return [3, 3];
|
|
264
|
-
case 6: return [3, 9];
|
|
265
|
-
case 7:
|
|
266
|
-
e_4_1 = _f.sent();
|
|
267
|
-
e_4 = { error: e_4_1 };
|
|
268
|
-
return [3, 9];
|
|
269
|
-
case 8:
|
|
270
|
-
try {
|
|
271
|
-
if (bucket_2_1 && !bucket_2_1.done && (_e = bucket_2.return)) _e.call(bucket_2);
|
|
272
|
-
}
|
|
273
|
-
finally { if (e_4) throw e_4.error; }
|
|
274
|
-
return [7];
|
|
275
|
-
case 9:
|
|
276
|
-
_b = _a.next();
|
|
277
|
-
return [3, 1];
|
|
278
|
-
case 10: return [3, 13];
|
|
279
|
-
case 11:
|
|
280
|
-
e_5_1 = _f.sent();
|
|
281
|
-
e_5 = { error: e_5_1 };
|
|
282
|
-
return [3, 13];
|
|
283
|
-
case 12:
|
|
284
|
-
try {
|
|
285
|
-
if (_b && !_b.done && (_d = _a.return)) _d.call(_a);
|
|
286
|
-
}
|
|
287
|
-
finally { if (e_5) throw e_5.error; }
|
|
288
|
-
return [7];
|
|
289
|
-
case 13: return [2];
|
|
122
|
+
}
|
|
123
|
+
*entries() {
|
|
124
|
+
for (const bucket of this.table) {
|
|
125
|
+
if (bucket) {
|
|
126
|
+
for (const [key, value] of bucket) {
|
|
127
|
+
yield [key, value];
|
|
128
|
+
}
|
|
290
129
|
}
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
[Symbol.iterator]() {
|
|
294
133
|
return this.entries();
|
|
295
|
-
}
|
|
296
|
-
|
|
134
|
+
}
|
|
135
|
+
clear() {
|
|
297
136
|
this.size = 0;
|
|
298
137
|
this.table = new Array(this.initialCapacity);
|
|
299
|
-
}
|
|
300
|
-
|
|
138
|
+
}
|
|
139
|
+
isEmpty() {
|
|
301
140
|
return this.size === 0;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
}());
|
|
141
|
+
}
|
|
142
|
+
}
|
|
305
143
|
exports.HashMap = HashMap;
|
|
306
144
|
//# sourceMappingURL=hash-map.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash-map.js","sourceRoot":"","sources":["../../../src/data-structures/hash/hash-map.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hash-map.js","sourceRoot":"","sources":["../../../src/data-structures/hash/hash-map.ts"],"names":[],"mappings":";;;AASA,MAAa,OAAO;IAClB,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,IAAI,MAAM,CAAC,KAAsB;QAC/B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACvB,CAAC;IACD,I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