deque-typed 1.54.3 → 2.0.1
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/README.md +91 -0
- package/dist/data-structures/base/iterable-element-base.d.ts +14 -40
- package/dist/data-structures/base/iterable-element-base.js +14 -11
- package/dist/data-structures/base/linear-base.d.ts +277 -0
- package/dist/data-structures/base/linear-base.js +552 -0
- package/dist/data-structures/binary-tree/avl-tree-multi-map.d.ts +12 -8
- package/dist/data-structures/binary-tree/avl-tree-multi-map.js +50 -37
- package/dist/data-structures/binary-tree/avl-tree.d.ts +64 -0
- package/dist/data-structures/binary-tree/avl-tree.js +64 -0
- package/dist/data-structures/binary-tree/binary-tree.js +5 -5
- package/dist/data-structures/binary-tree/bst.js +11 -11
- package/dist/data-structures/binary-tree/tree-multi-map.d.ts +175 -14
- package/dist/data-structures/binary-tree/tree-multi-map.js +210 -40
- package/dist/data-structures/graph/abstract-graph.js +16 -16
- package/dist/data-structures/hash/hash-map.d.ts +46 -0
- package/dist/data-structures/hash/hash-map.js +46 -0
- package/dist/data-structures/heap/heap.d.ts +3 -11
- package/dist/data-structures/heap/heap.js +0 -10
- package/dist/data-structures/heap/max-heap.d.ts +2 -2
- package/dist/data-structures/heap/min-heap.d.ts +2 -2
- package/dist/data-structures/linked-list/doubly-linked-list.d.ts +65 -94
- package/dist/data-structures/linked-list/doubly-linked-list.js +131 -146
- package/dist/data-structures/linked-list/singly-linked-list.d.ts +145 -75
- package/dist/data-structures/linked-list/singly-linked-list.js +283 -169
- package/dist/data-structures/priority-queue/max-priority-queue.d.ts +2 -2
- package/dist/data-structures/priority-queue/min-priority-queue.d.ts +2 -2
- package/dist/data-structures/priority-queue/priority-queue.d.ts +2 -2
- package/dist/data-structures/queue/deque.d.ts +130 -91
- package/dist/data-structures/queue/deque.js +269 -169
- package/dist/data-structures/queue/queue.d.ts +131 -40
- package/dist/data-structures/queue/queue.js +181 -50
- package/dist/data-structures/stack/stack.d.ts +124 -11
- package/dist/data-structures/stack/stack.js +121 -10
- package/dist/data-structures/trie/trie.d.ts +4 -3
- package/dist/data-structures/trie/trie.js +3 -0
- package/dist/types/data-structures/base/base.d.ts +9 -4
- package/dist/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +1 -1
- package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +1 -1
- package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +2 -2
- package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +2 -2
- package/dist/types/data-structures/queue/deque.d.ts +2 -3
- package/dist/types/data-structures/queue/queue.d.ts +2 -2
- package/package.json +2 -2
- package/src/data-structures/base/iterable-element-base.ts +29 -20
- package/src/data-structures/base/linear-base.ts +649 -0
- package/src/data-structures/binary-tree/avl-tree-multi-map.ts +51 -36
- package/src/data-structures/binary-tree/avl-tree.ts +64 -0
- package/src/data-structures/binary-tree/binary-tree.ts +5 -5
- package/src/data-structures/binary-tree/bst.ts +9 -9
- package/src/data-structures/binary-tree/tree-multi-map.ts +214 -40
- package/src/data-structures/graph/abstract-graph.ts +16 -16
- package/src/data-structures/hash/hash-map.ts +46 -0
- package/src/data-structures/heap/heap.ts +3 -14
- package/src/data-structures/heap/max-heap.ts +2 -2
- package/src/data-structures/heap/min-heap.ts +2 -2
- package/src/data-structures/linked-list/doubly-linked-list.ts +144 -160
- package/src/data-structures/linked-list/singly-linked-list.ts +307 -185
- package/src/data-structures/priority-queue/max-priority-queue.ts +2 -5
- package/src/data-structures/priority-queue/min-priority-queue.ts +2 -5
- package/src/data-structures/priority-queue/priority-queue.ts +2 -2
- package/src/data-structures/queue/deque.ts +286 -183
- package/src/data-structures/queue/queue.ts +196 -63
- package/src/data-structures/stack/stack.ts +124 -18
- package/src/data-structures/trie/trie.ts +7 -3
- package/src/types/data-structures/base/base.ts +17 -8
- package/src/types/data-structures/binary-tree/avl-tree-multi-map.ts +1 -1
- package/src/types/data-structures/binary-tree/tree-multi-map.ts +1 -1
- package/src/types/data-structures/linked-list/doubly-linked-list.ts +2 -2
- package/src/types/data-structures/linked-list/singly-linked-list.ts +2 -2
- package/src/types/data-structures/queue/deque.ts +2 -3
- package/src/types/data-structures/queue/queue.ts +2 -2
|
@@ -64,10 +64,7 @@ export class MaxPriorityQueue<E = any, R = any> extends PriorityQueue<E, R> {
|
|
|
64
64
|
* @returns The `filter` method is returning a new `MaxPriorityQueue` object that contains the elements that pass
|
|
65
65
|
* the filter condition specified by the `callback` function.
|
|
66
66
|
*/
|
|
67
|
-
override filter(
|
|
68
|
-
callback: ElementCallback<E, R, boolean, MaxPriorityQueue<E, R>>,
|
|
69
|
-
thisArg?: any
|
|
70
|
-
): MaxPriorityQueue<E, R> {
|
|
67
|
+
override filter(callback: ElementCallback<E, R, boolean>, thisArg?: any): MaxPriorityQueue<E, R> {
|
|
71
68
|
const filteredPriorityQueue = new MaxPriorityQueue<E, R>([], {
|
|
72
69
|
toElementFn: this.toElementFn,
|
|
73
70
|
comparator: this.comparator
|
|
@@ -104,7 +101,7 @@ export class MaxPriorityQueue<E = any, R = any> extends PriorityQueue<E, R> {
|
|
|
104
101
|
* @returns a new instance of the `MaxPriorityQueue` class with the mapped elements.
|
|
105
102
|
*/
|
|
106
103
|
override map<EM, RM>(
|
|
107
|
-
callback: ElementCallback<E, R, EM
|
|
104
|
+
callback: ElementCallback<E, R, EM>,
|
|
108
105
|
comparator: Comparator<EM>,
|
|
109
106
|
toElementFn?: (rawElement: RM) => EM,
|
|
110
107
|
thisArg?: any
|
|
@@ -53,10 +53,7 @@ export class MinPriorityQueue<E = any, R = any> extends PriorityQueue<E, R> {
|
|
|
53
53
|
* @returns The `filter` method is returning a new `MinPriorityQueue` object that contains the elements that pass
|
|
54
54
|
* the filter condition specified by the `callback` function.
|
|
55
55
|
*/
|
|
56
|
-
override filter(
|
|
57
|
-
callback: ElementCallback<E, R, boolean, MinPriorityQueue<E, R>>,
|
|
58
|
-
thisArg?: any
|
|
59
|
-
): MinPriorityQueue<E, R> {
|
|
56
|
+
override filter(callback: ElementCallback<E, R, boolean>, thisArg?: any): MinPriorityQueue<E, R> {
|
|
60
57
|
const filteredPriorityQueue = new MinPriorityQueue<E, R>([], {
|
|
61
58
|
toElementFn: this.toElementFn,
|
|
62
59
|
comparator: this.comparator
|
|
@@ -93,7 +90,7 @@ export class MinPriorityQueue<E = any, R = any> extends PriorityQueue<E, R> {
|
|
|
93
90
|
* @returns a new instance of the `MinPriorityQueue` class with the mapped elements.
|
|
94
91
|
*/
|
|
95
92
|
override map<EM, RM>(
|
|
96
|
-
callback: ElementCallback<E, R, EM
|
|
93
|
+
callback: ElementCallback<E, R, EM>,
|
|
97
94
|
comparator: Comparator<EM>,
|
|
98
95
|
toElementFn?: (rawElement: RM) => EM,
|
|
99
96
|
thisArg?: any
|
|
@@ -55,7 +55,7 @@ export class PriorityQueue<E = any, R = any> extends Heap<E, R> {
|
|
|
55
55
|
* @returns The `filter` method is returning a new `PriorityQueue` object that contains the elements that pass
|
|
56
56
|
* the filter condition specified by the `callback` function.
|
|
57
57
|
*/
|
|
58
|
-
override filter(callback: ElementCallback<E, R, boolean
|
|
58
|
+
override filter(callback: ElementCallback<E, R, boolean>, thisArg?: any): PriorityQueue<E, R> {
|
|
59
59
|
const filteredPriorityQueue = new PriorityQueue<E, R>([], {
|
|
60
60
|
toElementFn: this.toElementFn,
|
|
61
61
|
comparator: this.comparator
|
|
@@ -92,7 +92,7 @@ export class PriorityQueue<E = any, R = any> extends Heap<E, R> {
|
|
|
92
92
|
* @returns a new instance of the `PriorityQueue` class with the mapped elements.
|
|
93
93
|
*/
|
|
94
94
|
override map<EM, RM>(
|
|
95
|
-
callback: ElementCallback<E, R, EM
|
|
95
|
+
callback: ElementCallback<E, R, EM>,
|
|
96
96
|
comparator: Comparator<EM>,
|
|
97
97
|
toElementFn?: (rawElement: RM) => EM,
|
|
98
98
|
thisArg?: any
|