data-structure-typed 2.6.0 → 2.6.2
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/.github/workflows/ci.yml +7 -2
- package/.github/workflows/release-package.yml +9 -2
- package/CHANGELOG.md +9 -1
- package/dist/cjs/binary-tree.cjs +2927 -23688
- package/dist/cjs/graph.cjs +845 -2634
- package/dist/cjs/hash.cjs +185 -616
- package/dist/cjs/heap.cjs +266 -818
- package/dist/cjs/index.cjs +5116 -31358
- package/dist/cjs/linked-list.cjs +644 -2615
- package/dist/cjs/matrix.cjs +220 -535
- package/dist/cjs/priority-queue.cjs +266 -818
- package/dist/cjs/queue.cjs +637 -2343
- package/dist/cjs/stack.cjs +124 -530
- package/dist/cjs/trie.cjs +145 -592
- package/dist/cjs-legacy/binary-tree.cjs +4352 -25113
- package/dist/cjs-legacy/graph.cjs +847 -2636
- package/dist/cjs-legacy/hash.cjs +181 -612
- package/dist/cjs-legacy/heap.cjs +266 -818
- package/dist/cjs-legacy/index.cjs +6657 -32899
- package/dist/cjs-legacy/linked-list.cjs +640 -2611
- package/dist/cjs-legacy/matrix.cjs +220 -535
- package/dist/cjs-legacy/priority-queue.cjs +266 -818
- package/dist/cjs-legacy/queue.cjs +634 -2340
- package/dist/cjs-legacy/stack.cjs +124 -530
- package/dist/cjs-legacy/trie.cjs +145 -592
- package/dist/esm/binary-tree.mjs +2927 -23688
- package/dist/esm/graph.mjs +845 -2634
- package/dist/esm/hash.mjs +185 -616
- package/dist/esm/heap.mjs +266 -818
- package/dist/esm/index.mjs +5116 -31358
- package/dist/esm/linked-list.mjs +644 -2615
- package/dist/esm/matrix.mjs +220 -535
- package/dist/esm/priority-queue.mjs +266 -818
- package/dist/esm/queue.mjs +637 -2343
- package/dist/esm/stack.mjs +124 -530
- package/dist/esm/trie.mjs +145 -592
- package/dist/esm-legacy/binary-tree.mjs +4352 -25113
- package/dist/esm-legacy/graph.mjs +847 -2636
- package/dist/esm-legacy/hash.mjs +181 -612
- package/dist/esm-legacy/heap.mjs +266 -818
- package/dist/esm-legacy/index.mjs +6657 -32899
- package/dist/esm-legacy/linked-list.mjs +640 -2611
- package/dist/esm-legacy/matrix.mjs +220 -535
- package/dist/esm-legacy/priority-queue.mjs +266 -818
- package/dist/esm-legacy/queue.mjs +634 -2340
- package/dist/esm-legacy/stack.mjs +124 -530
- package/dist/esm-legacy/trie.mjs +145 -592
- package/dist/types/data-structures/binary-tree/avl-tree.d.ts +29 -500
- package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +38 -563
- package/dist/types/data-structures/binary-tree/binary-tree.d.ts +230 -1212
- package/dist/types/data-structures/binary-tree/bst.d.ts +124 -1063
- package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +99 -854
- package/dist/types/data-structures/binary-tree/segment-tree.d.ts +62 -314
- package/dist/types/data-structures/binary-tree/tree-map.d.ts +366 -5057
- package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +277 -4885
- package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +253 -3929
- package/dist/types/data-structures/binary-tree/tree-set.d.ts +261 -4782
- package/dist/types/data-structures/graph/abstract-graph.d.ts +44 -44
- package/dist/types/data-structures/graph/directed-graph.d.ts +130 -527
- package/dist/types/data-structures/graph/undirected-graph.d.ts +125 -482
- package/dist/types/data-structures/hash/hash-map.d.ts +132 -562
- package/dist/types/data-structures/heap/heap.d.ts +194 -746
- package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +120 -809
- package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +121 -733
- package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +193 -863
- package/dist/types/data-structures/matrix/matrix.d.ts +159 -474
- package/dist/types/data-structures/priority-queue/max-priority-queue.d.ts +1 -6
- package/dist/types/data-structures/priority-queue/min-priority-queue.d.ts +6 -11
- package/dist/types/data-structures/priority-queue/priority-queue.d.ts +1 -1
- package/dist/types/data-structures/queue/deque.d.ts +196 -804
- package/dist/types/data-structures/queue/queue.d.ts +99 -585
- package/dist/types/data-structures/stack/stack.d.ts +75 -481
- package/dist/types/data-structures/trie/trie.d.ts +98 -584
- package/dist/umd/data-structure-typed.js +6580 -32822
- package/dist/umd/data-structure-typed.min.js +3 -3
- package/docs-site-docusaurus/docs/api/classes/AVLTree.md +162 -215
- package/docs-site-docusaurus/docs/api/classes/AVLTreeNode.md +9 -9
- package/docs-site-docusaurus/docs/api/classes/AbstractGraph.md +47 -47
- package/docs-site-docusaurus/docs/api/classes/BST.md +155 -208
- package/docs-site-docusaurus/docs/api/classes/BSTNode.md +7 -7
- package/docs-site-docusaurus/docs/api/classes/BinaryIndexedTree.md +13 -29
- package/docs-site-docusaurus/docs/api/classes/BinaryTree.md +104 -158
- package/docs-site-docusaurus/docs/api/classes/BinaryTreeNode.md +13 -13
- package/docs-site-docusaurus/docs/api/classes/Deque.md +253 -101
- package/docs-site-docusaurus/docs/api/classes/DirectedGraph.md +60 -80
- package/docs-site-docusaurus/docs/api/classes/DoublyLinkedList.md +244 -114
- package/docs-site-docusaurus/docs/api/classes/DoublyLinkedListNode.md +6 -6
- package/docs-site-docusaurus/docs/api/classes/FibonacciHeap.md +9 -9
- package/docs-site-docusaurus/docs/api/classes/FibonacciHeapNode.md +1 -1
- package/docs-site-docusaurus/docs/api/classes/HashMap.md +52 -48
- package/docs-site-docusaurus/docs/api/classes/Heap.md +119 -64
- package/docs-site-docusaurus/docs/api/classes/IterableElementBase.md +84 -14
- package/docs-site-docusaurus/docs/api/classes/LinearBase.md +138 -34
- package/docs-site-docusaurus/docs/api/classes/LinearLinkedBase.md +149 -41
- package/docs-site-docusaurus/docs/api/classes/LinkedHashMap.md +23 -23
- package/docs-site-docusaurus/docs/api/classes/LinkedListQueue.md +172 -92
- package/docs-site-docusaurus/docs/api/classes/MapGraph.md +60 -80
- package/docs-site-docusaurus/docs/api/classes/Matrix.md +57 -52
- package/docs-site-docusaurus/docs/api/classes/MaxHeap.md +117 -62
- package/docs-site-docusaurus/docs/api/classes/MaxPriorityQueue.md +120 -70
- package/docs-site-docusaurus/docs/api/classes/MinHeap.md +117 -62
- package/docs-site-docusaurus/docs/api/classes/MinPriorityQueue.md +125 -75
- package/docs-site-docusaurus/docs/api/classes/PriorityQueue.md +119 -64
- package/docs-site-docusaurus/docs/api/classes/Queue.md +158 -74
- package/docs-site-docusaurus/docs/api/classes/RedBlackTree.md +171 -225
- package/docs-site-docusaurus/docs/api/classes/SegmentTree.md +10 -22
- package/docs-site-docusaurus/docs/api/classes/SinglyLinkedList.md +172 -94
- package/docs-site-docusaurus/docs/api/classes/SinglyLinkedListNode.md +4 -4
- package/docs-site-docusaurus/docs/api/classes/SkipList.md +98 -75
- package/docs-site-docusaurus/docs/api/classes/Stack.md +112 -50
- package/docs-site-docusaurus/docs/api/classes/TreeMap.md +104 -129
- package/docs-site-docusaurus/docs/api/classes/TreeMultiMap.md +90 -121
- package/docs-site-docusaurus/docs/api/classes/TreeSet.md +298 -107
- package/docs-site-docusaurus/docs/api/classes/Trie.md +116 -58
- package/docs-site-docusaurus/docs/api/classes/TrieNode.md +8 -8
- package/docs-site-docusaurus/docs/api/classes/UndirectedGraph.md +59 -77
- package/package.json +45 -46
- package/src/common/error.ts +15 -32
- package/src/common/index.ts +0 -3
- package/src/data-structures/base/iterable-element-base.ts +0 -3
- package/src/data-structures/base/linear-base.ts +2 -36
- package/src/data-structures/binary-tree/avl-tree.ts +31 -529
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +47 -572
- package/src/data-structures/binary-tree/binary-tree.ts +326 -1311
- package/src/data-structures/binary-tree/bst.ts +158 -1082
- package/src/data-structures/binary-tree/red-black-tree.ts +451 -1290
- package/src/data-structures/binary-tree/segment-tree.ts +73 -351
- package/src/data-structures/binary-tree/tree-map.ts +462 -5124
- package/src/data-structures/binary-tree/tree-multi-map.ts +302 -4914
- package/src/data-structures/binary-tree/tree-multi-set.ts +299 -3983
- package/src/data-structures/binary-tree/tree-set.ts +338 -4836
- package/src/data-structures/graph/abstract-graph.ts +98 -167
- package/src/data-structures/graph/directed-graph.ts +137 -562
- package/src/data-structures/graph/map-graph.ts +0 -3
- package/src/data-structures/graph/undirected-graph.ts +132 -511
- package/src/data-structures/hash/hash-map.ts +154 -582
- package/src/data-structures/heap/heap.ts +200 -795
- package/src/data-structures/linked-list/doubly-linked-list.ts +121 -865
- package/src/data-structures/linked-list/singly-linked-list.ts +122 -794
- package/src/data-structures/linked-list/skip-linked-list.ts +211 -918
- package/src/data-structures/matrix/matrix.ts +179 -518
- package/src/data-structures/matrix/navigator.ts +0 -1
- package/src/data-structures/priority-queue/max-priority-queue.ts +1 -6
- package/src/data-structures/priority-queue/min-priority-queue.ts +6 -11
- package/src/data-structures/priority-queue/priority-queue.ts +1 -2
- package/src/data-structures/queue/deque.ts +214 -882
- package/src/data-structures/queue/queue.ts +102 -625
- package/src/data-structures/stack/stack.ts +76 -505
- package/src/data-structures/trie/trie.ts +98 -628
- package/src/types/common.ts +0 -10
- package/src/types/data-structures/binary-tree/bst.ts +0 -7
- package/src/types/data-structures/binary-tree/red-black-tree.ts +0 -1
- package/src/types/data-structures/graph/abstract-graph.ts +0 -2
- package/src/types/data-structures/hash/hash-map.ts +0 -3
- package/src/types/data-structures/hash/index.ts +0 -1
- package/src/types/data-structures/matrix/navigator.ts +0 -2
- package/src/types/utils/utils.ts +0 -7
- package/src/types/utils/validate-type.ts +0 -7
- package/src/utils/number.ts +0 -2
- package/src/utils/utils.ts +0 -5
|
@@ -42,6 +42,11 @@ export declare abstract class AbstractGraph<V = any, E = any, VO extends Abstrac
|
|
|
42
42
|
get vertexMap(): Map<VertexKey, VO>;
|
|
43
43
|
set vertexMap(v: Map<VertexKey, VO>);
|
|
44
44
|
get size(): number;
|
|
45
|
+
/**
|
|
46
|
+
* The edge connector string used in visual output.
|
|
47
|
+
* Override in subclasses (e.g., '--' for undirected, '->' for directed).
|
|
48
|
+
*/
|
|
49
|
+
protected get _edgeConnector(): string;
|
|
45
50
|
/**
|
|
46
51
|
* Create a new vertex instance (implementation specific).
|
|
47
52
|
* @param key - Vertex identifier.
|
|
@@ -269,6 +274,45 @@ export declare abstract class AbstractGraph<V = any, E = any, VO extends Abstrac
|
|
|
269
274
|
* @remarks Time O(V + E), Space O(V + E)
|
|
270
275
|
*/
|
|
271
276
|
clone(): this;
|
|
277
|
+
/**
|
|
278
|
+
* Generate a text-based visual representation of the graph.
|
|
279
|
+
*
|
|
280
|
+
* **Adjacency list format:**
|
|
281
|
+
* ```
|
|
282
|
+
* Graph (5 vertices, 6 edges):
|
|
283
|
+
* A -> B (1), C (2)
|
|
284
|
+
* B -> D (3)
|
|
285
|
+
* C -> (no outgoing edges)
|
|
286
|
+
* D -> A (1)
|
|
287
|
+
* E (isolated)
|
|
288
|
+
* ```
|
|
289
|
+
*
|
|
290
|
+
* @param options - Optional display settings.
|
|
291
|
+
* @param options.showWeight - Whether to show edge weights (default: true).
|
|
292
|
+
* @returns The visual string.
|
|
293
|
+
*/
|
|
294
|
+
toVisual(options?: {
|
|
295
|
+
showWeight?: boolean;
|
|
296
|
+
}): string;
|
|
297
|
+
/**
|
|
298
|
+
* Generate DOT language representation for Graphviz.
|
|
299
|
+
*
|
|
300
|
+
* @param options - Optional display settings.
|
|
301
|
+
* @param options.name - Graph name (default: 'G').
|
|
302
|
+
* @param options.showWeight - Whether to label edges with weight (default: true).
|
|
303
|
+
* @returns DOT format string.
|
|
304
|
+
*/
|
|
305
|
+
toDot(options?: {
|
|
306
|
+
name?: string;
|
|
307
|
+
showWeight?: boolean;
|
|
308
|
+
}): string;
|
|
309
|
+
/**
|
|
310
|
+
* Print the graph to console.
|
|
311
|
+
* @param options - Display settings passed to `toVisual`.
|
|
312
|
+
*/
|
|
313
|
+
print(options?: {
|
|
314
|
+
showWeight?: boolean;
|
|
315
|
+
}): void;
|
|
272
316
|
/**
|
|
273
317
|
* Internal iterator over `[key, value]` entries in insertion order.
|
|
274
318
|
* @returns Iterator of `[VertexKey, V | undefined]`.
|
|
@@ -337,48 +381,4 @@ export declare abstract class AbstractGraph<V = any, E = any, VO extends Abstrac
|
|
|
337
381
|
* @remarks Time O(1), Space O(1)
|
|
338
382
|
*/
|
|
339
383
|
protected _getVertexKey(vertexOrKey: VO | VertexKey): VertexKey;
|
|
340
|
-
/**
|
|
341
|
-
* The edge connector string used in visual output.
|
|
342
|
-
* Override in subclasses (e.g., '--' for undirected, '->' for directed).
|
|
343
|
-
*/
|
|
344
|
-
protected get _edgeConnector(): string;
|
|
345
|
-
/**
|
|
346
|
-
* Generate a text-based visual representation of the graph.
|
|
347
|
-
*
|
|
348
|
-
* **Adjacency list format:**
|
|
349
|
-
* ```
|
|
350
|
-
* Graph (5 vertices, 6 edges):
|
|
351
|
-
* A -> B (1), C (2)
|
|
352
|
-
* B -> D (3)
|
|
353
|
-
* C -> (no outgoing edges)
|
|
354
|
-
* D -> A (1)
|
|
355
|
-
* E (isolated)
|
|
356
|
-
* ```
|
|
357
|
-
*
|
|
358
|
-
* @param options - Optional display settings.
|
|
359
|
-
* @param options.showWeight - Whether to show edge weights (default: true).
|
|
360
|
-
* @returns The visual string.
|
|
361
|
-
*/
|
|
362
|
-
toVisual(options?: {
|
|
363
|
-
showWeight?: boolean;
|
|
364
|
-
}): string;
|
|
365
|
-
/**
|
|
366
|
-
* Generate DOT language representation for Graphviz.
|
|
367
|
-
*
|
|
368
|
-
* @param options - Optional display settings.
|
|
369
|
-
* @param options.name - Graph name (default: 'G').
|
|
370
|
-
* @param options.showWeight - Whether to label edges with weight (default: true).
|
|
371
|
-
* @returns DOT format string.
|
|
372
|
-
*/
|
|
373
|
-
toDot(options?: {
|
|
374
|
-
name?: string;
|
|
375
|
-
showWeight?: boolean;
|
|
376
|
-
}): string;
|
|
377
|
-
/**
|
|
378
|
-
* Print the graph to console.
|
|
379
|
-
* @param options - Display settings passed to `toVisual`.
|
|
380
|
-
*/
|
|
381
|
-
print(options?: {
|
|
382
|
-
showWeight?: boolean;
|
|
383
|
-
}): void;
|
|
384
384
|
}
|