data-structure-typed 1.33.6 → 1.33.8

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.
Files changed (51) hide show
  1. package/.github/workflows/ci.yml +1 -0
  2. package/CHANGELOG.md +1 -1
  3. package/README.md +42 -38
  4. package/coverage/coverage-final.json +64 -63
  5. package/coverage/coverage-summary.json +8 -7
  6. package/dist/data-structures/binary-tree/segment-tree.js +24 -6
  7. package/dist/data-structures/binary-tree/segment-tree.js.map +1 -1
  8. package/dist/data-structures/hash/hash-map.js +306 -0
  9. package/dist/data-structures/hash/hash-map.js.map +1 -0
  10. package/dist/data-structures/hash/hash-table.js +128 -38
  11. package/dist/data-structures/hash/hash-table.js.map +1 -1
  12. package/dist/data-structures/hash/index.js +1 -0
  13. package/dist/data-structures/hash/index.js.map +1 -1
  14. package/dist/data-structures/linked-list/skip-linked-list.js +122 -5
  15. package/dist/data-structures/linked-list/skip-linked-list.js.map +1 -1
  16. package/dist/types/data-structures/hash.js +3 -0
  17. package/dist/types/data-structures/hash.js.map +1 -0
  18. package/dist/types/data-structures/index.js +1 -0
  19. package/dist/types/data-structures/index.js.map +1 -1
  20. package/docs/index.html +35 -37
  21. package/docs/modules.html +10 -4
  22. package/lib/data-structures/binary-tree/segment-tree.d.ts +4 -4
  23. package/lib/data-structures/binary-tree/segment-tree.js +30 -14
  24. package/lib/data-structures/hash/hash-map.d.ts +56 -0
  25. package/lib/data-structures/hash/hash-map.js +167 -0
  26. package/lib/data-structures/hash/hash-table.d.ts +67 -23
  27. package/lib/data-structures/hash/hash-table.js +154 -52
  28. package/lib/data-structures/hash/index.d.ts +1 -0
  29. package/lib/data-structures/hash/index.js +1 -0
  30. package/lib/data-structures/linked-list/skip-linked-list.d.ts +60 -1
  31. package/lib/data-structures/linked-list/skip-linked-list.js +136 -1
  32. package/lib/types/data-structures/hash.d.ts +1 -0
  33. package/lib/types/data-structures/hash.js +1 -0
  34. package/lib/types/data-structures/index.d.ts +1 -0
  35. package/lib/types/data-structures/index.js +1 -0
  36. package/package.json +22 -22
  37. package/src/data-structures/binary-tree/segment-tree.ts +32 -14
  38. package/src/data-structures/hash/hash-map.ts +203 -0
  39. package/src/data-structures/hash/hash-table.ts +176 -56
  40. package/src/data-structures/hash/index.ts +1 -0
  41. package/src/data-structures/linked-list/skip-linked-list.ts +166 -1
  42. package/src/types/data-structures/hash.ts +1 -0
  43. package/src/types/data-structures/index.ts +1 -0
  44. package/test/integration/index.html +26 -18
  45. package/test/unit/data-structures/binary-tree/segment-tree.test.ts +50 -0
  46. package/test/unit/data-structures/hash/hash-map.test.ts +104 -0
  47. package/test/unit/data-structures/hash/hash-table.test.ts +97 -10
  48. package/test/unit/data-structures/linked-list/skip-list.test.ts +55 -0
  49. package/umd/bundle.min.js +1 -1
  50. package/umd/bundle.min.js.map +1 -1
  51. package/tsconfig.prod.json +0 -25
@@ -9,6 +9,7 @@ on:
9
9
  paths-ignore:
10
10
  - 'lib/**'
11
11
  - 'dist/**'
12
+ - 'umd/**'
12
13
  - 'docs/**'
13
14
  - 'coverage/**'
14
15
  - '**/*.md'
package/CHANGELOG.md CHANGED
@@ -8,7 +8,7 @@ All notable changes to this project will be documented in this file.
8
8
  - [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
9
9
  - [`auto-changelog`](https://github.com/CookPete/auto-changelog)
10
10
 
11
- ## [v1.33.5](https://github.com/zrwusa/data-structure-typed/compare/v1.33.4...main) (upcoming)
11
+ ## [v1.33.7](https://github.com/zrwusa/data-structure-typed/compare/v1.33.4...main) (upcoming)
12
12
 
13
13
  ## [v1.33.4](https://github.com/zrwusa/data-structure-typed/compare/v1.33.3...v1.33.4) (26 September 2023)
14
14
 
package/README.md CHANGED
@@ -2,17 +2,27 @@
2
2
 
3
3
  Data Structures of Javascript & TypeScript.
4
4
 
5
- Do you envy languages like C++ with [std](), Python with [collections](), and Java with [java.util]() ? Well, no need to envy anymore! JavaScript and TypeScript now have [data-structure-typed]().
5
+ Do you envy C++ with [std](), Python with [collections](), and Java with [java.util]() ? Well, no need to envy anymore! JavaScript and TypeScript now have [data-structure-typed]().
6
6
 
7
7
  Now you can use this library in Node.js and browser environments in CommonJS(require export.modules = ), ESModule(import export), Typescript(import export), UMD(var Queue = dataStructureTyped.Queue)
8
8
 
9
+ The size after packaging is 69 kB.
10
+
9
11
  ![License](https://img.shields.io/badge/License-MIT-blue.svg)
10
12
  ![Language](https://img.shields.io/github/languages/top/zrwusa/data-structure-typed)
11
13
  ![GitHub release (latest by date)](https://img.shields.io/github/v/release/zrwusa/data-structure-typed)
12
- ![Branches](https://img.shields.io/badge/branches-97.54%25-brightgreen.svg?style=flat)
13
14
  ![npm](https://aleen42.github.io/badges/src/npm.svg)
14
15
  ![eslint](https://aleen42.github.io/badges/src/eslint.svg)
15
16
 
17
+ [//]: # (![Branches](https://img.shields.io/badge/branches-55.47%25-red.svg?style=flat))
18
+
19
+ [//]: # (![Statements](https://img.shields.io/badge/statements-67%25-red.svg?style=flat))
20
+
21
+ [//]: # (![Functions](https://img.shields.io/badge/functions-66.38%25-red.svg?style=flat))
22
+
23
+ [//]: # (![Lines](https://img.shields.io/badge/lines-68.6%25-red.svg?style=flat))
24
+
25
+
16
26
  ## Built-in classic algorithms
17
27
 
18
28
  DFS(Depth-First Search), DFSIterative, BFS(Breadth-First Search), morris, Bellman-Ford Algorithm, Dijkstra's Algorithm,
@@ -23,7 +33,7 @@ Floyd-Warshall Algorithm, Tarjan's Algorithm.
23
33
  ### npm
24
34
 
25
35
  ```bash
26
- npm i data-structure-typed --save
36
+ npm i data-structure-typed
27
37
  ```
28
38
 
29
39
  ### yarn
@@ -32,6 +42,14 @@ npm i data-structure-typed --save
32
42
  yarn add data-structure-typed
33
43
  ```
34
44
 
45
+ ```js
46
+ import {
47
+ BinaryTree, Graph, Queue, Stack, PriorityQueue, BST, Trie, DoublyLinkedList,
48
+ AVLTree, MinHeap, SinglyLinkedList, DirectedGraph, TreeMultiset,
49
+ DirectedVertex, AVLTreeNode
50
+ } from 'data-structure-typed';
51
+ ```
52
+
35
53
  ### CDN
36
54
 
37
55
  ```html
@@ -40,18 +58,11 @@ yarn add data-structure-typed
40
58
  ```
41
59
 
42
60
  ```js
43
- const {AVLTree} = dataStructureTyped;
61
+ const {Heap} = dataStructureTyped;
44
62
  const {
45
- Heap,
46
- MinHeap,
47
- SinglyLinkedList,
48
- Stack,
49
- AVLTreeNode,
50
- BST,
51
- Trie,
52
- DirectedGraph,
53
- DirectedVertex,
54
- TreeMultiset
63
+ BinaryTree, Graph, Queue, Stack, PriorityQueue, BST, Trie, DoublyLinkedList,
64
+ AVLTree, MinHeap, SinglyLinkedList, DirectedGraph, TreeMultiset,
65
+ DirectedVertex, AVLTreeNode
55
66
  } = dataStructureTyped;
56
67
  ```
57
68
 
@@ -441,24 +452,17 @@ Array.from(dijkstraResult?.seen ?? []).map(vertex => vertex.id) // ['A', 'B', 'D
441
452
  <tr>
442
453
  <td>Set</td>
443
454
  <td>std::set&lt;T&gt;</td>
444
- <td>Set</td>
455
+ <td>Set&lt;E&gt</td>
445
456
  <td>HashSet&lt;E&gt;</td>
446
457
  <td>set</td>
447
458
  </tr>
448
459
  <tr>
449
460
  <td>Map</td>
450
461
  <td>std::map&lt;K, V&gt;</td>
451
- <td>Map</td>
462
+ <td>Map&lt;K, V&gt;</td>
452
463
  <td>HashMap&lt;K, V&gt;</td>
453
464
  <td>dict</td>
454
465
  </tr>
455
- <tr>
456
- <td>Unordered Map</td>
457
- <td>std::unordered_map&lt;K, V&gt;</td>
458
- <td>N/A</td>
459
- <td>HashMap&lt;K, V&gt;</td>
460
- <td>defaultdict</td>
461
- </tr>
462
466
  <tr>
463
467
  <td>Unordered Set</td>
464
468
  <td>std::unordered_set&lt;T&gt;</td>
@@ -466,24 +470,31 @@ Array.from(dijkstraResult?.seen ?? []).map(vertex => vertex.id) // ['A', 'B', 'D
466
470
  <td>HashSet&lt;E&gt;</td>
467
471
  <td>N/A</td>
468
472
  </tr>
473
+ <tr>
474
+ <td>Unordered Map</td>
475
+ <td>std::unordered_map&lt;K, V&gt;</td>
476
+ <td>HashMap&lt;K, V&gt;</td>
477
+ <td>HashMap&lt;K, V&gt;</td>
478
+ <td>defaultdict</td>
479
+ </tr>
469
480
  <tr>
470
481
  <td>Queue</td>
471
482
  <td>std::queue&lt;T&gt;</td>
472
- <td>Queue</td>
483
+ <td>Queue&lt;E&gt;</td>
473
484
  <td>Queue&lt;E&gt;</td>
474
485
  <td>N/A</td>
475
486
  </tr>
476
487
  <tr>
477
488
  <td>Priority Queue</td>
478
489
  <td>std::priority_queue&lt;T&gt;</td>
479
- <td>PriorityQueue</td>
490
+ <td>PriorityQueue&lt;E&gt;</td>
480
491
  <td>PriorityQueue&lt;E&gt;</td>
481
492
  <td>N/A</td>
482
493
  </tr>
483
494
  <tr>
484
495
  <td>Stack</td>
485
496
  <td>std::stack&lt;T&gt;</td>
486
- <td>Stack</td>
497
+ <td>Stack&lt;E&gt;</td>
487
498
  <td>Stack&lt;E&gt;</td>
488
499
  <td>N/A</td>
489
500
  </tr>
@@ -497,7 +508,7 @@ Array.from(dijkstraResult?.seen ?? []).map(vertex => vertex.id) // ['A', 'B', 'D
497
508
  <tr>
498
509
  <td>Deque</td>
499
510
  <td>std::deque&lt;T&gt;</td>
500
- <td>Deque</td>
511
+ <td>Deque&lt;E&gt;</td>
501
512
  <td>N/A</td>
502
513
  <td>N/A</td>
503
514
  </tr>
@@ -525,17 +536,10 @@ Array.from(dijkstraResult?.seen ?? []).map(vertex => vertex.id) // ['A', 'B', 'D
525
536
  <tr>
526
537
  <td>Ordered Dictionary</td>
527
538
  <td>N/A</td>
528
- <td>Map</td>
539
+ <td>Map&lt;K, V&gt;</td>
529
540
  <td>N/A</td>
530
541
  <td>OrderedDict</td>
531
542
  </tr>
532
- <tr>
533
- <td>Double-Ended Queue (Deque)</td>
534
- <td>std::deque&lt;T&gt;</td>
535
- <td>Deque</td>
536
- <td>N/A</td>
537
- <td>N/A</td>
538
- </tr>
539
543
  <tr>
540
544
  <td>Linked Hash Set</td>
541
545
  <td>N/A</td>
@@ -553,21 +557,21 @@ Array.from(dijkstraResult?.seen ?? []).map(vertex => vertex.id) // ['A', 'B', 'D
553
557
  <tr>
554
558
  <td>Sorted Set</td>
555
559
  <td>N/A</td>
556
- <td>AVLTree, RBTree</td>
560
+ <td>AVLTree</td>
557
561
  <td>TreeSet&lt;E&gt;</td>
558
562
  <td>N/A</td>
559
563
  </tr>
560
564
  <tr>
561
565
  <td>Sorted Map</td>
562
566
  <td>N/A</td>
563
- <td>AVLTree, RBTree</td>
567
+ <td>AVLTree</td>
564
568
  <td>TreeMap&lt;K, V&gt;</td>
565
569
  <td>N/A</td>
566
570
  </tr>
567
571
  <tr>
568
572
  <td>Tree Set</td>
569
573
  <td>std::set</td>
570
- <td>AVLTree, RBTree</td>
574
+ <td>AVLTree</td>
571
575
  <td>TreeSet&lt;E&gt;</td>
572
576
  <td>N/A</td>
573
577
  </tr>