data-structure-typed 1.39.4 → 1.39.6
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/CHANGELOG.md +3 -1
- package/dist/cjs/data-structures/binary-tree/avl-tree.d.ts +6 -6
- package/dist/cjs/data-structures/binary-tree/avl-tree.js +13 -13
- package/dist/cjs/data-structures/binary-tree/avl-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/binary-tree.d.ts +7 -7
- package/dist/cjs/data-structures/binary-tree/binary-tree.js +17 -17
- package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/bst.d.ts +6 -6
- package/dist/cjs/data-structures/binary-tree/bst.js +13 -13
- package/dist/cjs/data-structures/binary-tree/bst.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/rb-tree.d.ts +2 -2
- package/dist/cjs/data-structures/binary-tree/rb-tree.js +4 -4
- package/dist/cjs/data-structures/binary-tree/rb-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/segment-tree.d.ts +7 -7
- package/dist/cjs/data-structures/binary-tree/segment-tree.js +16 -16
- package/dist/cjs/data-structures/binary-tree/segment-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/tree-multiset.d.ts +6 -6
- package/dist/cjs/data-structures/binary-tree/tree-multiset.js +18 -18
- package/dist/cjs/data-structures/binary-tree/tree-multiset.js.map +1 -1
- package/dist/cjs/data-structures/graph/abstract-graph.d.ts +96 -96
- package/dist/cjs/data-structures/graph/abstract-graph.js +64 -64
- package/dist/cjs/data-structures/graph/abstract-graph.js.map +1 -1
- package/dist/cjs/data-structures/graph/directed-graph.d.ts +68 -68
- package/dist/cjs/data-structures/graph/directed-graph.js +48 -48
- package/dist/cjs/data-structures/graph/directed-graph.js.map +1 -1
- package/dist/cjs/data-structures/graph/map-graph.d.ts +13 -13
- package/dist/cjs/data-structures/graph/map-graph.js +15 -15
- package/dist/cjs/data-structures/graph/map-graph.js.map +1 -1
- package/dist/cjs/data-structures/graph/undirected-graph.d.ts +42 -42
- package/dist/cjs/data-structures/graph/undirected-graph.js +32 -32
- package/dist/cjs/data-structures/graph/undirected-graph.js.map +1 -1
- package/dist/cjs/data-structures/hash/hash-table.d.ts +4 -4
- package/dist/cjs/data-structures/hash/hash-table.js +8 -8
- package/dist/cjs/data-structures/hash/hash-table.js.map +1 -1
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.d.ts +31 -31
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.js +54 -54
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.js.map +1 -1
- package/dist/cjs/data-structures/linked-list/singly-linked-list.d.ts +24 -24
- package/dist/cjs/data-structures/linked-list/singly-linked-list.js +52 -52
- package/dist/cjs/data-structures/linked-list/singly-linked-list.js.map +1 -1
- package/dist/cjs/data-structures/queue/queue.d.ts +1 -1
- package/dist/cjs/data-structures/queue/queue.js +4 -4
- package/dist/cjs/data-structures/queue/queue.js.map +1 -1
- package/dist/cjs/interfaces/binary-tree.d.ts +2 -2
- package/dist/cjs/interfaces/graph.d.ts +3 -3
- package/dist/mjs/data-structures/binary-tree/avl-tree.d.ts +6 -6
- package/dist/mjs/data-structures/binary-tree/avl-tree.js +13 -13
- package/dist/mjs/data-structures/binary-tree/binary-tree.d.ts +7 -7
- package/dist/mjs/data-structures/binary-tree/binary-tree.js +18 -18
- package/dist/mjs/data-structures/binary-tree/bst.d.ts +6 -6
- package/dist/mjs/data-structures/binary-tree/bst.js +13 -13
- package/dist/mjs/data-structures/binary-tree/rb-tree.d.ts +2 -2
- package/dist/mjs/data-structures/binary-tree/rb-tree.js +4 -4
- package/dist/mjs/data-structures/binary-tree/segment-tree.d.ts +7 -7
- package/dist/mjs/data-structures/binary-tree/segment-tree.js +16 -16
- package/dist/mjs/data-structures/binary-tree/tree-multiset.d.ts +6 -6
- package/dist/mjs/data-structures/binary-tree/tree-multiset.js +18 -18
- package/dist/mjs/data-structures/graph/abstract-graph.d.ts +96 -96
- package/dist/mjs/data-structures/graph/abstract-graph.js +66 -66
- package/dist/mjs/data-structures/graph/directed-graph.d.ts +68 -68
- package/dist/mjs/data-structures/graph/directed-graph.js +48 -48
- package/dist/mjs/data-structures/graph/map-graph.d.ts +13 -13
- package/dist/mjs/data-structures/graph/map-graph.js +15 -15
- package/dist/mjs/data-structures/graph/undirected-graph.d.ts +42 -42
- package/dist/mjs/data-structures/graph/undirected-graph.js +32 -32
- package/dist/mjs/data-structures/hash/hash-table.d.ts +4 -4
- package/dist/mjs/data-structures/hash/hash-table.js +9 -9
- package/dist/mjs/data-structures/linked-list/doubly-linked-list.d.ts +31 -31
- package/dist/mjs/data-structures/linked-list/doubly-linked-list.js +55 -55
- package/dist/mjs/data-structures/linked-list/singly-linked-list.d.ts +24 -24
- package/dist/mjs/data-structures/linked-list/singly-linked-list.js +53 -53
- package/dist/mjs/data-structures/queue/queue.d.ts +1 -1
- package/dist/mjs/data-structures/queue/queue.js +4 -4
- package/dist/mjs/interfaces/binary-tree.d.ts +2 -2
- package/dist/mjs/interfaces/graph.d.ts +3 -3
- package/dist/umd/data-structure-typed.min.js +1 -1
- package/dist/umd/data-structure-typed.min.js.map +1 -1
- package/package.json +5 -5
- package/src/data-structures/binary-tree/avl-tree.ts +13 -13
- package/src/data-structures/binary-tree/binary-tree.ts +18 -18
- package/src/data-structures/binary-tree/bst.ts +16 -16
- package/src/data-structures/binary-tree/rb-tree.ts +6 -6
- package/src/data-structures/binary-tree/segment-tree.ts +15 -15
- package/src/data-structures/binary-tree/tree-multiset.ts +18 -18
- package/src/data-structures/graph/abstract-graph.ts +156 -154
- package/src/data-structures/graph/directed-graph.ts +99 -94
- package/src/data-structures/graph/map-graph.ts +22 -25
- package/src/data-structures/graph/undirected-graph.ts +62 -60
- package/src/data-structures/hash/hash-table.ts +9 -9
- package/src/data-structures/linked-list/doubly-linked-list.ts +61 -61
- package/src/data-structures/linked-list/singly-linked-list.ts +58 -58
- package/src/data-structures/queue/queue.ts +2 -2
- package/src/interfaces/binary-tree.ts +2 -2
- package/src/interfaces/graph.ts +3 -3
- package/test/integration/bst.test.ts +2 -2
- package/test/unit/data-structures/binary-tree/avl-tree.test.ts +2 -2
- package/test/unit/data-structures/binary-tree/binary-index-tree.test.ts +3 -3
- package/test/unit/data-structures/binary-tree/binary-tree.test.ts +8 -8
- package/test/unit/data-structures/binary-tree/bst.test.ts +4 -4
- package/test/unit/data-structures/binary-tree/rb-tree.test.ts +3 -3
- package/test/unit/data-structures/binary-tree/tree-multiset.test.ts +2 -2
- package/test/unit/data-structures/graph/abstract-graph.test.ts +99 -2
- package/test/unit/data-structures/graph/directed-graph.test.ts +38 -23
- package/test/unit/data-structures/graph/map-graph.test.ts +23 -23
- package/test/unit/data-structures/graph/undirected-graph.test.ts +10 -2
- package/test/unit/data-structures/hash/hash-table.test.ts +1 -1
- package/test/unit/data-structures/linked-list/doubly-linked-list.test.ts +30 -30
- package/test/unit/data-structures/linked-list/linked-list.test.ts +1 -1
- package/test/unit/data-structures/linked-list/singly-linked-list.test.ts +15 -15
- package/test/unit/data-structures/queue/queue.test.ts +8 -8
- package/test/utils/big-o.ts +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash-table.js","sourceRoot":"","sources":["../../../../src/data-structures/hash/hash-table.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,MAAa,aAAa;IAKxB,YAAY,GAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"hash-table.js","sourceRoot":"","sources":["../../../../src/data-structures/hash/hash-table.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,MAAa,aAAa;IAKxB,YAAY,GAAM,EAAE,KAAQ;QAC1B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAVD,sCAUC;AAID,MAAa,SAAS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,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/C,CAAC;IAED;;;OAGG;IACO,OAAO;QACf,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACvC,MAAM,UAAU,GAAG,IAAI,KAAK,CAA6B,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEjF,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE;YAClC,IAAI,WAAW,GAAG,MAAM,CAAC;YACzB,OAAO,WAAW,EAAE;gBAClB,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;gBAC7C,MAAM,OAAO,GAAG,IAAI,aAAa,CAAO,WAAW,CAAC,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;gBAE5E,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;oBACzB,UAAU,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC;iBAChC;qBAAM;oBACL,IAAI,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAE,CAAC;oBAC3C,OAAO,cAAc,CAAC,IAAI,EAAE;wBAC1B,cAAc,GAAG,cAAc,CAAC,IAAI,CAAC;qBACtC;oBACD,cAAc,CAAC,IAAI,GAAG,OAAO,CAAC;iBAC/B;gBACD,WAAW,GAAG,WAAW,CAAC,IAAI,CAAC;aAChC;SACF;QAED,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,WAAW,CAAC;IAC/B,CAAC;;AAhQH,8BAiQC;AAhQyB,0BAAgB,GAAG,EAAE,CAAC;AACtB,qBAAW,GAAG,IAAI,CAAC"}
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
export declare class DoublyLinkedListNode<E = any> {
|
|
9
9
|
/**
|
|
10
10
|
* The constructor function initializes the value, next, and previous properties of an object.
|
|
11
|
-
* @param {E}
|
|
11
|
+
* @param {E} value - The "value" parameter is the value that will be stored in the node. It can be of any data type, as it
|
|
12
12
|
* is defined as a generic type "E".
|
|
13
13
|
*/
|
|
14
|
-
constructor(
|
|
15
|
-
private
|
|
16
|
-
get
|
|
17
|
-
set
|
|
14
|
+
constructor(value: E);
|
|
15
|
+
private _value;
|
|
16
|
+
get value(): E;
|
|
17
|
+
set value(value: E);
|
|
18
18
|
private _next;
|
|
19
19
|
get next(): DoublyLinkedListNode<E> | null;
|
|
20
20
|
set next(value: DoublyLinkedListNode<E> | null);
|
|
@@ -45,23 +45,23 @@ export declare class DoublyLinkedList<E = any> {
|
|
|
45
45
|
static fromArray<E>(data: E[]): DoublyLinkedList<E>;
|
|
46
46
|
/**
|
|
47
47
|
* The push function adds a new node with the given value to the end of the doubly linked list.
|
|
48
|
-
* @param {E}
|
|
48
|
+
* @param {E} value - The value to be added to the linked list.
|
|
49
49
|
*/
|
|
50
|
-
push(
|
|
50
|
+
push(value: E): void;
|
|
51
51
|
/**
|
|
52
52
|
* The addLast function adds a new node with the given value to the end of the doubly linked list.
|
|
53
|
-
* @param {E}
|
|
53
|
+
* @param {E} value - The value to be added to the linked list.
|
|
54
54
|
*/
|
|
55
|
-
addLast(
|
|
55
|
+
addLast(value: E): void;
|
|
56
56
|
/**
|
|
57
57
|
* The `pop()` function removes and returns the value of the last node in a doubly linked list.
|
|
58
|
-
* @returns The method is returning the value of the removed node (removedNode.
|
|
58
|
+
* @returns The method is returning the value of the removed node (removedNode.value) if the list is not empty. If the
|
|
59
59
|
* list is empty, it returns null.
|
|
60
60
|
*/
|
|
61
61
|
pop(): E | undefined;
|
|
62
62
|
/**
|
|
63
63
|
* The `popLast()` function removes and returns the value of the last node in a doubly linked list.
|
|
64
|
-
* @returns The method is returning the value of the removed node (removedNode.
|
|
64
|
+
* @returns The method is returning the value of the removed node (removedNode.value) if the list is not empty. If the
|
|
65
65
|
* list is empty, it returns null.
|
|
66
66
|
*/
|
|
67
67
|
popLast(): E | undefined;
|
|
@@ -79,16 +79,16 @@ export declare class DoublyLinkedList<E = any> {
|
|
|
79
79
|
popFirst(): E | undefined;
|
|
80
80
|
/**
|
|
81
81
|
* The unshift function adds a new node with the given value to the beginning of a doubly linked list.
|
|
82
|
-
* @param {E}
|
|
82
|
+
* @param {E} value - The `value` parameter represents the value of the new node that will be added to the beginning of the
|
|
83
83
|
* doubly linked list.
|
|
84
84
|
*/
|
|
85
|
-
unshift(
|
|
85
|
+
unshift(value: E): void;
|
|
86
86
|
/**
|
|
87
87
|
* The addFirst function adds a new node with the given value to the beginning of a doubly linked list.
|
|
88
|
-
* @param {E}
|
|
88
|
+
* @param {E} value - The `value` parameter represents the value of the new node that will be added to the beginning of the
|
|
89
89
|
* doubly linked list.
|
|
90
90
|
*/
|
|
91
|
-
addFirst(
|
|
91
|
+
addFirst(value: E): void;
|
|
92
92
|
/**
|
|
93
93
|
* The `getFirst` function returns the first node in a doubly linked list, or null if the list is empty.
|
|
94
94
|
* @returns The method `getFirst()` returns the first node of the doubly linked list, or `null` if the list is empty.
|
|
@@ -119,21 +119,21 @@ export declare class DoublyLinkedList<E = any> {
|
|
|
119
119
|
/**
|
|
120
120
|
* The function `findNodeByValue` searches for a node with a specific value in a doubly linked list and returns the
|
|
121
121
|
* node if found, otherwise it returns null.
|
|
122
|
-
* @param {E}
|
|
123
|
-
* @returns The function `findNodeByValue` returns a `DoublyLinkedListNode<E>` if a node with the specified value `
|
|
122
|
+
* @param {E} value - The `value` parameter is the value that we want to search for in the doubly linked list.
|
|
123
|
+
* @returns The function `findNodeByValue` returns a `DoublyLinkedListNode<E>` if a node with the specified value `value`
|
|
124
124
|
* is found in the linked list. If no such node is found, it returns `null`.
|
|
125
125
|
*/
|
|
126
|
-
getNode(
|
|
126
|
+
getNode(value: E | null): DoublyLinkedListNode<E> | null;
|
|
127
127
|
/**
|
|
128
128
|
* The `insert` function inserts a value at a specified index in a doubly linked list.
|
|
129
129
|
* @param {number} index - The index parameter represents the position at which the new value should be inserted in the
|
|
130
130
|
* DoublyLinkedList. It is of type number.
|
|
131
|
-
* @param {E}
|
|
131
|
+
* @param {E} value - The `value` parameter represents the value that you want to insert into the Doubly Linked List at the
|
|
132
132
|
* specified index.
|
|
133
133
|
* @returns The `insert` method returns a boolean value. It returns `true` if the insertion is successful, and `false`
|
|
134
134
|
* if the index is out of bounds.
|
|
135
135
|
*/
|
|
136
|
-
insertAt(index: number,
|
|
136
|
+
insertAt(index: number, value: E): boolean;
|
|
137
137
|
/**
|
|
138
138
|
* The `insertBefore` function inserts a new value before an existing value or node in a doubly linked list.
|
|
139
139
|
* @param {E | DoublyLinkedListNode<E>} existingValueOrNode - The existing value or node in the doubly linked list
|
|
@@ -182,15 +182,15 @@ export declare class DoublyLinkedList<E = any> {
|
|
|
182
182
|
* @returns The method `find` returns the first element in the linked list that satisfies the condition specified by
|
|
183
183
|
* the callback function. If no element satisfies the condition, it returns `null`.
|
|
184
184
|
*/
|
|
185
|
-
find(callback: (
|
|
185
|
+
find(callback: (value: E) => boolean): E | null;
|
|
186
186
|
/**
|
|
187
187
|
* The function returns the index of the first occurrence of a given value in a linked list.
|
|
188
|
-
* @param {E}
|
|
188
|
+
* @param {E} value - The parameter `value` is of type `E`, which means it can be any data type. It represents the value
|
|
189
189
|
* that we are searching for in the linked list.
|
|
190
|
-
* @returns The method `indexOf` returns the index of the first occurrence of the specified value `
|
|
190
|
+
* @returns The method `indexOf` returns the index of the first occurrence of the specified value `value` in the linked
|
|
191
191
|
* list. If the value is not found, it returns -1.
|
|
192
192
|
*/
|
|
193
|
-
indexOf(
|
|
193
|
+
indexOf(value: E): number;
|
|
194
194
|
/**
|
|
195
195
|
* The `findBackward` function iterates through a linked list from the last node to the first node and returns the last
|
|
196
196
|
* value that satisfies the given callback function, or null if no value satisfies the callback.
|
|
@@ -199,7 +199,7 @@ export declare class DoublyLinkedList<E = any> {
|
|
|
199
199
|
* @returns The method `findBackward` returns the last value in the linked list that satisfies the condition specified by
|
|
200
200
|
* the callback function. If no value satisfies the condition, it returns `null`.
|
|
201
201
|
*/
|
|
202
|
-
findBackward(callback: (
|
|
202
|
+
findBackward(callback: (value: E) => boolean): E | null;
|
|
203
203
|
/**
|
|
204
204
|
* The `toArrayBackward` function converts a doubly linked list into an array in reverse order.
|
|
205
205
|
* @returns The `toArrayBackward()` function returns an array of type `E[]`.
|
|
@@ -211,11 +211,11 @@ export declare class DoublyLinkedList<E = any> {
|
|
|
211
211
|
reverse(): void;
|
|
212
212
|
/**
|
|
213
213
|
* The `forEach` function iterates over each element in a linked list and applies a callback function to each element.
|
|
214
|
-
* @param callback - The callback parameter is a function that takes two arguments:
|
|
214
|
+
* @param callback - The callback parameter is a function that takes two arguments: value and index. The value argument
|
|
215
215
|
* represents the value of the current node in the linked list, and the index argument represents the index of the
|
|
216
216
|
* current node in the linked list.
|
|
217
217
|
*/
|
|
218
|
-
forEach(callback: (
|
|
218
|
+
forEach(callback: (value: E, index: number) => void): void;
|
|
219
219
|
/**
|
|
220
220
|
* The `map` function takes a callback function and applies it to each element in the DoublyLinkedList, returning a new
|
|
221
221
|
* DoublyLinkedList with the transformed values.
|
|
@@ -224,7 +224,7 @@ export declare class DoublyLinkedList<E = any> {
|
|
|
224
224
|
* DoublyLinkedList).
|
|
225
225
|
* @returns The `map` function is returning a new instance of `DoublyLinkedList<U>` that contains the mapped values.
|
|
226
226
|
*/
|
|
227
|
-
map<U>(callback: (
|
|
227
|
+
map<U>(callback: (value: E) => U): DoublyLinkedList<U>;
|
|
228
228
|
/**
|
|
229
229
|
* The `filter` function iterates through a DoublyLinkedList and returns a new DoublyLinkedList containing only the
|
|
230
230
|
* elements that satisfy the given callback function.
|
|
@@ -232,18 +232,18 @@ export declare class DoublyLinkedList<E = any> {
|
|
|
232
232
|
* It is used to determine whether a value should be included in the filtered list or not.
|
|
233
233
|
* @returns The filtered list, which is an instance of the DoublyLinkedList class.
|
|
234
234
|
*/
|
|
235
|
-
filter(callback: (
|
|
235
|
+
filter(callback: (value: E) => boolean): DoublyLinkedList<E>;
|
|
236
236
|
/**
|
|
237
237
|
* The `reduce` function iterates over a linked list and applies a callback function to each element, accumulating a
|
|
238
238
|
* single value.
|
|
239
|
-
* @param callback - The `callback` parameter is a function that takes two arguments: `accumulator` and `
|
|
239
|
+
* @param callback - The `callback` parameter is a function that takes two arguments: `accumulator` and `value`. It is
|
|
240
240
|
* used to perform a specific operation on each element of the linked list.
|
|
241
241
|
* @param {U} initialValue - The `initialValue` parameter is the initial value of the accumulator. It is the starting
|
|
242
242
|
* point for the reduction operation.
|
|
243
243
|
* @returns The `reduce` method is returning the final value of the accumulator after iterating through all the
|
|
244
244
|
* elements in the linked list.
|
|
245
245
|
*/
|
|
246
|
-
reduce<U>(callback: (accumulator: U,
|
|
246
|
+
reduce<U>(callback: (accumulator: U, value: E) => U, initialValue: U): U;
|
|
247
247
|
/**
|
|
248
248
|
* The `insertAfter` function inserts a new node with a given value after an existing node in a doubly linked list.
|
|
249
249
|
* @param {E | DoublyLinkedListNode<E>} existingValueOrNode - The existing value or node in the doubly linked list
|
|
@@ -11,19 +11,19 @@ exports.DoublyLinkedList = exports.DoublyLinkedListNode = void 0;
|
|
|
11
11
|
class DoublyLinkedListNode {
|
|
12
12
|
/**
|
|
13
13
|
* The constructor function initializes the value, next, and previous properties of an object.
|
|
14
|
-
* @param {E}
|
|
14
|
+
* @param {E} value - The "value" parameter is the value that will be stored in the node. It can be of any data type, as it
|
|
15
15
|
* is defined as a generic type "E".
|
|
16
16
|
*/
|
|
17
|
-
constructor(
|
|
18
|
-
this.
|
|
17
|
+
constructor(value) {
|
|
18
|
+
this._value = value;
|
|
19
19
|
this._next = null;
|
|
20
20
|
this._prev = null;
|
|
21
21
|
}
|
|
22
|
-
get
|
|
23
|
-
return this.
|
|
22
|
+
get value() {
|
|
23
|
+
return this._value;
|
|
24
24
|
}
|
|
25
|
-
set
|
|
26
|
-
this.
|
|
25
|
+
set value(value) {
|
|
26
|
+
this._value = value;
|
|
27
27
|
}
|
|
28
28
|
get next() {
|
|
29
29
|
return this._next;
|
|
@@ -81,10 +81,10 @@ class DoublyLinkedList {
|
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
83
|
* The push function adds a new node with the given value to the end of the doubly linked list.
|
|
84
|
-
* @param {E}
|
|
84
|
+
* @param {E} value - The value to be added to the linked list.
|
|
85
85
|
*/
|
|
86
|
-
push(
|
|
87
|
-
const newNode = new DoublyLinkedListNode(
|
|
86
|
+
push(value) {
|
|
87
|
+
const newNode = new DoublyLinkedListNode(value);
|
|
88
88
|
if (!this.head) {
|
|
89
89
|
this.head = newNode;
|
|
90
90
|
this.tail = newNode;
|
|
@@ -98,14 +98,14 @@ class DoublyLinkedList {
|
|
|
98
98
|
}
|
|
99
99
|
/**
|
|
100
100
|
* The addLast function adds a new node with the given value to the end of the doubly linked list.
|
|
101
|
-
* @param {E}
|
|
101
|
+
* @param {E} value - The value to be added to the linked list.
|
|
102
102
|
*/
|
|
103
|
-
addLast(
|
|
104
|
-
this.push(
|
|
103
|
+
addLast(value) {
|
|
104
|
+
this.push(value);
|
|
105
105
|
}
|
|
106
106
|
/**
|
|
107
107
|
* The `pop()` function removes and returns the value of the last node in a doubly linked list.
|
|
108
|
-
* @returns The method is returning the value of the removed node (removedNode.
|
|
108
|
+
* @returns The method is returning the value of the removed node (removedNode.value) if the list is not empty. If the
|
|
109
109
|
* list is empty, it returns null.
|
|
110
110
|
*/
|
|
111
111
|
pop() {
|
|
@@ -121,11 +121,11 @@ class DoublyLinkedList {
|
|
|
121
121
|
this.tail.next = null;
|
|
122
122
|
}
|
|
123
123
|
this._length--;
|
|
124
|
-
return removedNode.
|
|
124
|
+
return removedNode.value;
|
|
125
125
|
}
|
|
126
126
|
/**
|
|
127
127
|
* The `popLast()` function removes and returns the value of the last node in a doubly linked list.
|
|
128
|
-
* @returns The method is returning the value of the removed node (removedNode.
|
|
128
|
+
* @returns The method is returning the value of the removed node (removedNode.value) if the list is not empty. If the
|
|
129
129
|
* list is empty, it returns null.
|
|
130
130
|
*/
|
|
131
131
|
popLast() {
|
|
@@ -149,7 +149,7 @@ class DoublyLinkedList {
|
|
|
149
149
|
this.head.prev = null;
|
|
150
150
|
}
|
|
151
151
|
this._length--;
|
|
152
|
-
return removedNode.
|
|
152
|
+
return removedNode.value;
|
|
153
153
|
}
|
|
154
154
|
/**
|
|
155
155
|
* The `popFirst()` function removes and returns the value of the first node in a doubly linked list.
|
|
@@ -161,11 +161,11 @@ class DoublyLinkedList {
|
|
|
161
161
|
}
|
|
162
162
|
/**
|
|
163
163
|
* The unshift function adds a new node with the given value to the beginning of a doubly linked list.
|
|
164
|
-
* @param {E}
|
|
164
|
+
* @param {E} value - The `value` parameter represents the value of the new node that will be added to the beginning of the
|
|
165
165
|
* doubly linked list.
|
|
166
166
|
*/
|
|
167
|
-
unshift(
|
|
168
|
-
const newNode = new DoublyLinkedListNode(
|
|
167
|
+
unshift(value) {
|
|
168
|
+
const newNode = new DoublyLinkedListNode(value);
|
|
169
169
|
if (!this.head) {
|
|
170
170
|
this.head = newNode;
|
|
171
171
|
this.tail = newNode;
|
|
@@ -179,11 +179,11 @@ class DoublyLinkedList {
|
|
|
179
179
|
}
|
|
180
180
|
/**
|
|
181
181
|
* The addFirst function adds a new node with the given value to the beginning of a doubly linked list.
|
|
182
|
-
* @param {E}
|
|
182
|
+
* @param {E} value - The `value` parameter represents the value of the new node that will be added to the beginning of the
|
|
183
183
|
* doubly linked list.
|
|
184
184
|
*/
|
|
185
|
-
addFirst(
|
|
186
|
-
this.unshift(
|
|
185
|
+
addFirst(value) {
|
|
186
|
+
this.unshift(value);
|
|
187
187
|
}
|
|
188
188
|
/**
|
|
189
189
|
* The `getFirst` function returns the first node in a doubly linked list, or null if the list is empty.
|
|
@@ -191,7 +191,7 @@ class DoublyLinkedList {
|
|
|
191
191
|
*/
|
|
192
192
|
getFirst() {
|
|
193
193
|
var _a;
|
|
194
|
-
return (_a = this.head) === null || _a === void 0 ? void 0 : _a.
|
|
194
|
+
return (_a = this.head) === null || _a === void 0 ? void 0 : _a.value;
|
|
195
195
|
}
|
|
196
196
|
/**
|
|
197
197
|
* The `getLast` function returns the last node in a doubly linked list, or null if the list is empty.
|
|
@@ -199,7 +199,7 @@ class DoublyLinkedList {
|
|
|
199
199
|
*/
|
|
200
200
|
getLast() {
|
|
201
201
|
var _a;
|
|
202
|
-
return (_a = this.tail) === null || _a === void 0 ? void 0 : _a.
|
|
202
|
+
return (_a = this.tail) === null || _a === void 0 ? void 0 : _a.value;
|
|
203
203
|
}
|
|
204
204
|
/**
|
|
205
205
|
* The `getAt` function returns the value at a specified index in a linked list, or null if the index is out of bounds.
|
|
@@ -215,7 +215,7 @@ class DoublyLinkedList {
|
|
|
215
215
|
for (let i = 0; i < index; i++) {
|
|
216
216
|
current = current.next;
|
|
217
217
|
}
|
|
218
|
-
return current.
|
|
218
|
+
return current.value;
|
|
219
219
|
}
|
|
220
220
|
/**
|
|
221
221
|
* The function `getNodeAt` returns the node at a given index in a doubly linked list, or null if the index is out of
|
|
@@ -237,14 +237,14 @@ class DoublyLinkedList {
|
|
|
237
237
|
/**
|
|
238
238
|
* The function `findNodeByValue` searches for a node with a specific value in a doubly linked list and returns the
|
|
239
239
|
* node if found, otherwise it returns null.
|
|
240
|
-
* @param {E}
|
|
241
|
-
* @returns The function `findNodeByValue` returns a `DoublyLinkedListNode<E>` if a node with the specified value `
|
|
240
|
+
* @param {E} value - The `value` parameter is the value that we want to search for in the doubly linked list.
|
|
241
|
+
* @returns The function `findNodeByValue` returns a `DoublyLinkedListNode<E>` if a node with the specified value `value`
|
|
242
242
|
* is found in the linked list. If no such node is found, it returns `null`.
|
|
243
243
|
*/
|
|
244
|
-
getNode(
|
|
244
|
+
getNode(value) {
|
|
245
245
|
let current = this.head;
|
|
246
246
|
while (current) {
|
|
247
|
-
if (current.
|
|
247
|
+
if (current.value === value) {
|
|
248
248
|
return current;
|
|
249
249
|
}
|
|
250
250
|
current = current.next;
|
|
@@ -255,23 +255,23 @@ class DoublyLinkedList {
|
|
|
255
255
|
* The `insert` function inserts a value at a specified index in a doubly linked list.
|
|
256
256
|
* @param {number} index - The index parameter represents the position at which the new value should be inserted in the
|
|
257
257
|
* DoublyLinkedList. It is of type number.
|
|
258
|
-
* @param {E}
|
|
258
|
+
* @param {E} value - The `value` parameter represents the value that you want to insert into the Doubly Linked List at the
|
|
259
259
|
* specified index.
|
|
260
260
|
* @returns The `insert` method returns a boolean value. It returns `true` if the insertion is successful, and `false`
|
|
261
261
|
* if the index is out of bounds.
|
|
262
262
|
*/
|
|
263
|
-
insertAt(index,
|
|
263
|
+
insertAt(index, value) {
|
|
264
264
|
if (index < 0 || index > this.length)
|
|
265
265
|
return false;
|
|
266
266
|
if (index === 0) {
|
|
267
|
-
this.unshift(
|
|
267
|
+
this.unshift(value);
|
|
268
268
|
return true;
|
|
269
269
|
}
|
|
270
270
|
if (index === this.length) {
|
|
271
|
-
this.push(
|
|
271
|
+
this.push(value);
|
|
272
272
|
return true;
|
|
273
273
|
}
|
|
274
|
-
const newNode = new DoublyLinkedListNode(
|
|
274
|
+
const newNode = new DoublyLinkedListNode(value);
|
|
275
275
|
const prevNode = this.getNodeAt(index - 1);
|
|
276
276
|
const nextNode = prevNode.next;
|
|
277
277
|
newNode.prev = prevNode;
|
|
@@ -335,7 +335,7 @@ class DoublyLinkedList {
|
|
|
335
335
|
prevNode.next = nextNode;
|
|
336
336
|
nextNode.prev = prevNode;
|
|
337
337
|
this._length--;
|
|
338
|
-
return removedNode.
|
|
338
|
+
return removedNode.value;
|
|
339
339
|
}
|
|
340
340
|
/**
|
|
341
341
|
* The `delete` function removes a node from a doubly linked list based on either the node itself or its value.
|
|
@@ -378,7 +378,7 @@ class DoublyLinkedList {
|
|
|
378
378
|
const array = [];
|
|
379
379
|
let current = this.head;
|
|
380
380
|
while (current) {
|
|
381
|
-
array.push(current.
|
|
381
|
+
array.push(current.value);
|
|
382
382
|
current = current.next;
|
|
383
383
|
}
|
|
384
384
|
return array;
|
|
@@ -408,8 +408,8 @@ class DoublyLinkedList {
|
|
|
408
408
|
find(callback) {
|
|
409
409
|
let current = this.head;
|
|
410
410
|
while (current) {
|
|
411
|
-
if (callback(current.
|
|
412
|
-
return current.
|
|
411
|
+
if (callback(current.value)) {
|
|
412
|
+
return current.value;
|
|
413
413
|
}
|
|
414
414
|
current = current.next;
|
|
415
415
|
}
|
|
@@ -417,16 +417,16 @@ class DoublyLinkedList {
|
|
|
417
417
|
}
|
|
418
418
|
/**
|
|
419
419
|
* The function returns the index of the first occurrence of a given value in a linked list.
|
|
420
|
-
* @param {E}
|
|
420
|
+
* @param {E} value - The parameter `value` is of type `E`, which means it can be any data type. It represents the value
|
|
421
421
|
* that we are searching for in the linked list.
|
|
422
|
-
* @returns The method `indexOf` returns the index of the first occurrence of the specified value `
|
|
422
|
+
* @returns The method `indexOf` returns the index of the first occurrence of the specified value `value` in the linked
|
|
423
423
|
* list. If the value is not found, it returns -1.
|
|
424
424
|
*/
|
|
425
|
-
indexOf(
|
|
425
|
+
indexOf(value) {
|
|
426
426
|
let index = 0;
|
|
427
427
|
let current = this.head;
|
|
428
428
|
while (current) {
|
|
429
|
-
if (current.
|
|
429
|
+
if (current.value === value) {
|
|
430
430
|
return index;
|
|
431
431
|
}
|
|
432
432
|
index++;
|
|
@@ -445,8 +445,8 @@ class DoublyLinkedList {
|
|
|
445
445
|
findBackward(callback) {
|
|
446
446
|
let current = this.tail;
|
|
447
447
|
while (current) {
|
|
448
|
-
if (callback(current.
|
|
449
|
-
return current.
|
|
448
|
+
if (callback(current.value)) {
|
|
449
|
+
return current.value;
|
|
450
450
|
}
|
|
451
451
|
current = current.prev;
|
|
452
452
|
}
|
|
@@ -460,7 +460,7 @@ class DoublyLinkedList {
|
|
|
460
460
|
const array = [];
|
|
461
461
|
let current = this.tail;
|
|
462
462
|
while (current) {
|
|
463
|
-
array.push(current.
|
|
463
|
+
array.push(current.value);
|
|
464
464
|
current = current.prev;
|
|
465
465
|
}
|
|
466
466
|
return array;
|
|
@@ -479,7 +479,7 @@ class DoublyLinkedList {
|
|
|
479
479
|
}
|
|
480
480
|
/**
|
|
481
481
|
* The `forEach` function iterates over each element in a linked list and applies a callback function to each element.
|
|
482
|
-
* @param callback - The callback parameter is a function that takes two arguments:
|
|
482
|
+
* @param callback - The callback parameter is a function that takes two arguments: value and index. The value argument
|
|
483
483
|
* represents the value of the current node in the linked list, and the index argument represents the index of the
|
|
484
484
|
* current node in the linked list.
|
|
485
485
|
*/
|
|
@@ -487,7 +487,7 @@ class DoublyLinkedList {
|
|
|
487
487
|
let current = this.head;
|
|
488
488
|
let index = 0;
|
|
489
489
|
while (current) {
|
|
490
|
-
callback(current.
|
|
490
|
+
callback(current.value, index);
|
|
491
491
|
current = current.next;
|
|
492
492
|
index++;
|
|
493
493
|
}
|
|
@@ -504,7 +504,7 @@ class DoublyLinkedList {
|
|
|
504
504
|
const mappedList = new DoublyLinkedList();
|
|
505
505
|
let current = this.head;
|
|
506
506
|
while (current) {
|
|
507
|
-
mappedList.push(callback(current.
|
|
507
|
+
mappedList.push(callback(current.value));
|
|
508
508
|
current = current.next;
|
|
509
509
|
}
|
|
510
510
|
return mappedList;
|
|
@@ -520,8 +520,8 @@ class DoublyLinkedList {
|
|
|
520
520
|
const filteredList = new DoublyLinkedList();
|
|
521
521
|
let current = this.head;
|
|
522
522
|
while (current) {
|
|
523
|
-
if (callback(current.
|
|
524
|
-
filteredList.push(current.
|
|
523
|
+
if (callback(current.value)) {
|
|
524
|
+
filteredList.push(current.value);
|
|
525
525
|
}
|
|
526
526
|
current = current.next;
|
|
527
527
|
}
|
|
@@ -530,7 +530,7 @@ class DoublyLinkedList {
|
|
|
530
530
|
/**
|
|
531
531
|
* The `reduce` function iterates over a linked list and applies a callback function to each element, accumulating a
|
|
532
532
|
* single value.
|
|
533
|
-
* @param callback - The `callback` parameter is a function that takes two arguments: `accumulator` and `
|
|
533
|
+
* @param callback - The `callback` parameter is a function that takes two arguments: `accumulator` and `value`. It is
|
|
534
534
|
* used to perform a specific operation on each element of the linked list.
|
|
535
535
|
* @param {U} initialValue - The `initialValue` parameter is the initial value of the accumulator. It is the starting
|
|
536
536
|
* point for the reduction operation.
|
|
@@ -541,7 +541,7 @@ class DoublyLinkedList {
|
|
|
541
541
|
let accumulator = initialValue;
|
|
542
542
|
let current = this.head;
|
|
543
543
|
while (current) {
|
|
544
|
-
accumulator = callback(accumulator, current.
|
|
544
|
+
accumulator = callback(accumulator, current.value);
|
|
545
545
|
current = current.next;
|
|
546
546
|
}
|
|
547
547
|
return accumulator;
|
|
@@ -585,7 +585,7 @@ class DoublyLinkedList {
|
|
|
585
585
|
*[Symbol.iterator]() {
|
|
586
586
|
let current = this.head;
|
|
587
587
|
while (current) {
|
|
588
|
-
yield current.
|
|
588
|
+
yield current.value;
|
|
589
589
|
current = current.next;
|
|
590
590
|
}
|
|
591
591
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doubly-linked-list.js","sourceRoot":"","sources":["../../../../src/data-structures/linked-list/doubly-linked-list.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,MAAa,oBAAoB;IAC/B;;;;OAIG;IACH,YAAY,GAAM;QAChB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAID,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,IAAI,GAAG,CAAC,KAAQ;QACd,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;IACpB,CAAC;IAID,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,IAAI,IAAI,CAAC,KAAqC;QAC5C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAID,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,IAAI,IAAI,CAAC,KAA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AAI,EAAE;gBACrB,YAAY,CAAC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;aAClC;YACD,OAAO,CAAC,IAAI,GAAG,YAAY,CAAC;YAC5B,YAAY,CAAC,IAAI,GAAG,OAAO,CAAC;YAC5B,IAAI,YAAY,KAAK,IAAI,CAAC,IAAI,EAAE;gBAC9B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;aACrB;YACD,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,OAAO,IAAI,CAAC;SACb;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACH,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;QAChB,IAAI,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC;QAExB,OAAO,OAAO,EAAE;YACd,MAAM,OAAO,CAAC,GAAG,CAAC;YAClB,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;SACxB;IACH,CAAC;CACF;AA5kBD,4CA4kBC"}
|
|
1
|
+
{"version":3,"file":"doubly-linked-list.js","sourceRoot":"","sources":["../../../../src/data-structures/linked-list/doubly-linked-list.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,MAAa,oBAAoB;IAC/B;;;;OAIG;IACH,YAAY,KAAQ;QAClB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAID,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,IAAI,KAAK,CAAC,KAAQ;QAChB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAID,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,IAAI,IAAI,CAAC,KAAqC;QAC5C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAID,IAAI,IAAI;QACN,O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