data-structure-typed 1.33.0 → 1.33.5
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.json → .eslintrc.js} +2 -1
- package/.github/workflows/ci.yml +15 -3
- package/.github/workflows/release-package.yml +32 -0
- package/{.prettierrc → .prettierrc.js} +1 -1
- package/CHANGELOG.md +5 -1
- package/README.md +196 -257
- package/coverage/coverage-final.json +64 -64
- package/coverage/coverage-summary.json +16 -16
- package/dist/data-structures/binary-tree/abstract-binary-tree.js +1 -16
- package/dist/data-structures/binary-tree/abstract-binary-tree.js.map +1 -1
- package/dist/data-structures/binary-tree/avl-tree.js +2 -2
- package/dist/data-structures/binary-tree/avl-tree.js.map +1 -1
- package/dist/data-structures/binary-tree/rb-tree.js +3 -4
- package/dist/data-structures/binary-tree/rb-tree.js.map +1 -1
- package/dist/data-structures/graph/abstract-graph.js +12 -12
- package/dist/data-structures/graph/abstract-graph.js.map +1 -1
- package/dist/data-structures/graph/directed-graph.js.map +1 -1
- package/dist/data-structures/graph/undirected-graph.js.map +1 -1
- package/dist/data-structures/hash/hash-table.js +107 -2
- package/dist/data-structures/hash/hash-table.js.map +1 -1
- package/dist/data-structures/heap/max-heap.js.map +1 -1
- package/dist/data-structures/heap/min-heap.js.map +1 -1
- package/dist/data-structures/linked-list/doubly-linked-list.js +30 -0
- package/dist/data-structures/linked-list/doubly-linked-list.js.map +1 -1
- package/dist/data-structures/matrix/matrix2d.js +5 -8
- package/dist/data-structures/matrix/matrix2d.js.map +1 -1
- package/dist/data-structures/priority-queue/max-priority-queue.js.map +1 -1
- package/dist/data-structures/priority-queue/min-priority-queue.js.map +1 -1
- package/dist/data-structures/priority-queue/priority-queue.js +6 -6
- package/dist/data-structures/priority-queue/priority-queue.js.map +1 -1
- package/dist/data-structures/queue/deque.js.map +1 -1
- package/docs/index.html +196 -256
- package/docs/modules.html +2 -0
- package/lib/data-structures/binary-tree/abstract-binary-tree.d.ts +8 -18
- package/lib/data-structures/binary-tree/abstract-binary-tree.js +5 -23
- package/lib/data-structures/binary-tree/avl-tree.d.ts +7 -10
- package/lib/data-structures/binary-tree/avl-tree.js +6 -9
- package/lib/data-structures/binary-tree/binary-tree.d.ts +2 -2
- package/lib/data-structures/binary-tree/bst.d.ts +2 -2
- package/lib/data-structures/binary-tree/rb-tree.d.ts +3 -3
- package/lib/data-structures/binary-tree/rb-tree.js +3 -3
- package/lib/data-structures/binary-tree/tree-multiset.d.ts +3 -3
- package/lib/data-structures/binary-tree/tree-multiset.js +1 -1
- package/lib/data-structures/graph/abstract-graph.d.ts +10 -10
- package/lib/data-structures/graph/abstract-graph.js +2 -2
- package/lib/data-structures/graph/directed-graph.d.ts +6 -6
- package/lib/data-structures/graph/directed-graph.js +2 -2
- package/lib/data-structures/graph/map-graph.d.ts +6 -6
- package/lib/data-structures/graph/map-graph.js +2 -2
- package/lib/data-structures/graph/undirected-graph.d.ts +6 -6
- package/lib/data-structures/graph/undirected-graph.js +2 -2
- package/lib/data-structures/hash/hash-table.d.ts +61 -1
- package/lib/data-structures/hash/hash-table.js +136 -0
- package/lib/data-structures/heap/heap.d.ts +31 -31
- package/lib/data-structures/heap/heap.js +11 -11
- package/lib/data-structures/heap/max-heap.d.ts +4 -4
- package/lib/data-structures/heap/max-heap.js +1 -1
- package/lib/data-structures/heap/min-heap.d.ts +4 -4
- package/lib/data-structures/heap/min-heap.js +1 -1
- package/lib/data-structures/linked-list/doubly-linked-list.d.ts +93 -54
- package/lib/data-structures/linked-list/doubly-linked-list.js +79 -22
- package/lib/data-structures/linked-list/singly-linked-list.d.ts +46 -46
- package/lib/data-structures/linked-list/singly-linked-list.js +20 -20
- package/lib/data-structures/matrix/matrix.d.ts +3 -3
- package/lib/data-structures/matrix/matrix2d.d.ts +1 -1
- package/lib/data-structures/matrix/matrix2d.js +3 -2
- package/lib/data-structures/priority-queue/max-priority-queue.d.ts +4 -4
- package/lib/data-structures/priority-queue/min-priority-queue.d.ts +4 -4
- package/lib/data-structures/priority-queue/priority-queue.d.ts +26 -26
- package/lib/data-structures/priority-queue/priority-queue.js +8 -8
- package/lib/data-structures/queue/deque.d.ts +30 -30
- package/lib/data-structures/queue/deque.js +7 -7
- package/lib/data-structures/queue/queue.d.ts +27 -27
- package/lib/data-structures/queue/queue.js +8 -8
- package/lib/data-structures/stack/stack.d.ts +15 -15
- package/lib/data-structures/stack/stack.js +6 -6
- package/lib/data-structures/tree/tree.d.ts +7 -7
- package/lib/interfaces/abstract-binary-tree.d.ts +0 -1
- package/lib/interfaces/avl-tree.d.ts +1 -1
- package/lib/types/data-structures/navigator.d.ts +1 -1
- package/package.json +68 -62
- package/src/data-structures/binary-tree/aa-tree.ts +1 -0
- package/src/data-structures/binary-tree/abstract-binary-tree.ts +1608 -0
- package/src/data-structures/binary-tree/avl-tree.ts +307 -0
- package/src/data-structures/binary-tree/b-tree.ts +1 -0
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +76 -0
- package/src/data-structures/binary-tree/binary-tree.ts +47 -0
- package/src/data-structures/binary-tree/bst.ts +537 -0
- package/src/data-structures/binary-tree/index.ts +12 -0
- package/src/data-structures/binary-tree/rb-tree.ts +366 -0
- package/src/data-structures/binary-tree/segment-tree.ts +242 -0
- package/src/data-structures/binary-tree/splay-tree.ts +1 -0
- package/src/data-structures/binary-tree/tree-multiset.ts +700 -0
- package/src/data-structures/binary-tree/two-three-tree.ts +1 -0
- package/src/data-structures/graph/abstract-graph.ts +1040 -0
- package/src/data-structures/graph/directed-graph.ts +470 -0
- package/src/data-structures/graph/index.ts +4 -0
- package/src/data-structures/graph/map-graph.ts +129 -0
- package/src/data-structures/graph/undirected-graph.ts +274 -0
- package/src/data-structures/hash/coordinate-map.ts +67 -0
- package/src/data-structures/hash/coordinate-set.ts +56 -0
- package/src/data-structures/hash/hash-table.ts +157 -0
- package/src/data-structures/hash/index.ts +6 -0
- package/src/data-structures/hash/pair.ts +1 -0
- package/src/data-structures/hash/tree-map.ts +1 -0
- package/src/data-structures/hash/tree-set.ts +1 -0
- package/src/data-structures/heap/heap.ts +212 -0
- package/src/data-structures/heap/index.ts +3 -0
- package/src/data-structures/heap/max-heap.ts +31 -0
- package/src/data-structures/heap/min-heap.ts +32 -0
- package/src/data-structures/index.ts +11 -0
- package/src/data-structures/linked-list/doubly-linked-list.ts +636 -0
- package/src/data-structures/linked-list/index.ts +3 -0
- package/src/data-structures/linked-list/singly-linked-list.ts +501 -0
- package/src/data-structures/linked-list/skip-linked-list.ts +1 -0
- package/src/data-structures/matrix/index.ts +4 -0
- package/src/data-structures/matrix/matrix.ts +27 -0
- package/src/data-structures/matrix/matrix2d.ts +213 -0
- package/src/data-structures/matrix/navigator.ts +121 -0
- package/src/data-structures/matrix/vector2d.ts +316 -0
- package/src/data-structures/priority-queue/index.ts +3 -0
- package/src/data-structures/priority-queue/max-priority-queue.ts +56 -0
- package/src/data-structures/priority-queue/min-priority-queue.ts +57 -0
- package/src/data-structures/priority-queue/priority-queue.ts +359 -0
- package/src/data-structures/queue/deque.ts +297 -0
- package/src/data-structures/queue/index.ts +2 -0
- package/src/data-structures/queue/queue.ts +191 -0
- package/src/data-structures/stack/index.ts +1 -0
- package/src/data-structures/stack/stack.ts +98 -0
- package/src/data-structures/tree/index.ts +1 -0
- package/src/data-structures/tree/tree.ts +69 -0
- package/src/data-structures/trie/index.ts +1 -0
- package/src/data-structures/trie/trie.ts +225 -0
- package/src/index.ts +4 -0
- package/src/interfaces/abstract-binary-tree.ts +189 -0
- package/src/interfaces/abstract-graph.ts +31 -0
- package/src/interfaces/avl-tree.ts +25 -0
- package/src/interfaces/binary-tree.ts +6 -0
- package/src/interfaces/bst.ts +31 -0
- package/src/interfaces/directed-graph.ts +20 -0
- package/src/interfaces/doubly-linked-list.ts +1 -0
- package/src/interfaces/heap.ts +1 -0
- package/src/interfaces/index.ts +15 -0
- package/src/interfaces/navigator.ts +1 -0
- package/src/interfaces/priority-queue.ts +1 -0
- package/src/interfaces/rb-tree.ts +9 -0
- package/src/interfaces/segment-tree.ts +1 -0
- package/src/interfaces/singly-linked-list.ts +1 -0
- package/src/interfaces/tree-multiset.ts +7 -0
- package/src/interfaces/undirected-graph.ts +6 -0
- package/src/types/data-structures/abstract-binary-tree.ts +50 -0
- package/src/types/data-structures/abstract-graph.ts +11 -0
- package/src/types/data-structures/avl-tree.ts +5 -0
- package/src/types/data-structures/binary-tree.ts +5 -0
- package/src/types/data-structures/bst.ts +13 -0
- package/src/types/data-structures/directed-graph.ts +8 -0
- package/src/types/data-structures/doubly-linked-list.ts +1 -0
- package/src/types/data-structures/heap.ts +5 -0
- package/src/types/data-structures/index.ts +15 -0
- package/src/types/data-structures/map-graph.ts +1 -0
- package/src/types/data-structures/navigator.ts +13 -0
- package/src/types/data-structures/priority-queue.ts +9 -0
- package/src/types/data-structures/rb-tree.ts +8 -0
- package/src/types/data-structures/segment-tree.ts +1 -0
- package/src/types/data-structures/singly-linked-list.ts +1 -0
- package/src/types/data-structures/tree-multiset.ts +6 -0
- package/src/types/helpers.ts +1 -0
- package/src/types/index.ts +3 -0
- package/src/types/utils/index.ts +2 -0
- package/src/types/utils/utils.ts +6 -0
- package/src/types/utils/validate-type.ts +35 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/utils.ts +79 -0
- package/test/integration/avl-tree.test.ts +14 -17
- package/test/integration/bst.test.ts +50 -41
- package/test/integration/heap.test.js +0 -3
- package/test/integration/index.html +6 -6
- package/test/unit/data-structures/binary-tree/avl-tree.test.ts +14 -17
- package/test/unit/data-structures/binary-tree/binary-tree.test.ts +142 -0
- package/test/unit/data-structures/binary-tree/bst.test.ts +50 -41
- package/test/unit/data-structures/binary-tree/overall.test.ts +36 -28
- package/test/unit/data-structures/binary-tree/rb-tree.test.ts +43 -0
- package/test/unit/data-structures/binary-tree/tree-multiset.test.ts +23 -12
- package/test/unit/data-structures/graph/directed-graph.test.ts +27 -25
- package/test/unit/data-structures/graph/map-graph.test.ts +4 -5
- package/test/unit/data-structures/graph/overall.test.ts +10 -11
- package/test/unit/data-structures/graph/undirected-graph.test.ts +0 -1
- package/test/unit/data-structures/hash/coordinate-map.test.ts +54 -0
- package/test/unit/data-structures/hash/coordinate-set.test.ts +41 -0
- package/test/unit/data-structures/hash/hash-table.test.ts +97 -0
- package/test/unit/data-structures/heap/heap.test.ts +7 -8
- package/test/unit/data-structures/heap/max-heap.test.ts +7 -5
- package/test/unit/data-structures/heap/min-heap.test.ts +6 -5
- package/test/unit/data-structures/linked-list/doubly-linked-list.test.ts +8 -9
- package/test/unit/data-structures/linked-list/linked-list.test.ts +2 -4
- package/test/unit/data-structures/linked-list/singly-linked-list.test.ts +57 -7
- package/test/unit/data-structures/linked-list/skip-linked-list.test.ts +3 -3
- package/test/unit/data-structures/matrix/matrix.test.ts +54 -0
- package/test/unit/data-structures/matrix/matrix2d.test.ts +138 -0
- package/test/unit/data-structures/matrix/navigator.test.ts +79 -0
- package/test/unit/data-structures/priority-queue/max-priority-queue.test.ts +5 -7
- package/test/unit/data-structures/priority-queue/min-priority-queue.test.ts +13 -13
- package/test/unit/data-structures/priority-queue/priority-queue.test.ts +8 -8
- package/test/unit/data-structures/queue/deque.test.ts +130 -0
- package/test/unit/data-structures/queue/queue.test.ts +167 -4
- package/test/unit/data-structures/stack/stack.test.ts +67 -0
- package/test/unit/data-structures/tree/tree.test.ts +39 -0
- package/test/unit/data-structures/trie/trie.test.ts +95 -0
- package/test/utils/magnitude.ts +3 -3
- package/tsconfig.json +3 -12
- package/tsconfig.prod.json +25 -0
- package/umd/bundle.min.js +1 -1
- package/umd/bundle.min.js.map +1 -1
- package/.auto-changelog +0 -9
- package/.gitattributes +0 -112
- package/.idea/data-structure-typed.iml +0 -19
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/misc.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/.prettierignore +0 -6
- package/webpack.config.js +0 -28
package/.auto-changelog
DELETED
package/.gitattributes
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
# Common settings that generally should always be used with your language specific settings
|
|
2
|
-
|
|
3
|
-
# Auto detect text files and perform LF normalization
|
|
4
|
-
* text=auto
|
|
5
|
-
|
|
6
|
-
#
|
|
7
|
-
# The above will handle all files NOT found below
|
|
8
|
-
#
|
|
9
|
-
|
|
10
|
-
# Documents
|
|
11
|
-
*.bibtex text diff=bibtex
|
|
12
|
-
*.doc diff=astextplain
|
|
13
|
-
*.DOC diff=astextplain
|
|
14
|
-
*.docx diff=astextplain
|
|
15
|
-
*.DOCX diff=astextplain
|
|
16
|
-
*.dot diff=astextplain
|
|
17
|
-
*.DOT diff=astextplain
|
|
18
|
-
*.pdf diff=astextplain
|
|
19
|
-
*.PDF diff=astextplain
|
|
20
|
-
*.rtf diff=astextplain
|
|
21
|
-
*.RTF diff=astextplain
|
|
22
|
-
*.md text
|
|
23
|
-
*.tex text diff=tex
|
|
24
|
-
*.adoc text
|
|
25
|
-
*.textile text
|
|
26
|
-
*.mustache text
|
|
27
|
-
*.csv text
|
|
28
|
-
*.tab text
|
|
29
|
-
*.tsv text
|
|
30
|
-
*.txt text
|
|
31
|
-
*.sql text
|
|
32
|
-
|
|
33
|
-
# Graphics
|
|
34
|
-
*.png binary
|
|
35
|
-
*.jpg binary
|
|
36
|
-
*.jpeg binary
|
|
37
|
-
*.gif binary
|
|
38
|
-
*.tif binary
|
|
39
|
-
*.tiff binary
|
|
40
|
-
*.ico binary
|
|
41
|
-
# SVG treated as an asset (binary) by default.
|
|
42
|
-
*.svg text
|
|
43
|
-
# If you want to treat it as binary,
|
|
44
|
-
# use the following line instead.
|
|
45
|
-
# *.svg binary
|
|
46
|
-
*.eps binary
|
|
47
|
-
|
|
48
|
-
# Scripts
|
|
49
|
-
*.bash text eol=lf
|
|
50
|
-
*.fish text eol=lf
|
|
51
|
-
*.sh text eol=lf
|
|
52
|
-
# These are explicitly windows files and should use crlf
|
|
53
|
-
*.bat text eol=crlf
|
|
54
|
-
*.cmd text eol=crlf
|
|
55
|
-
*.ps1 text eol=crlf
|
|
56
|
-
|
|
57
|
-
# Serialisation
|
|
58
|
-
*.json text
|
|
59
|
-
*.toml text
|
|
60
|
-
*.xml text
|
|
61
|
-
*.yaml text
|
|
62
|
-
*.yml text
|
|
63
|
-
|
|
64
|
-
# Archives
|
|
65
|
-
*.7z binary
|
|
66
|
-
*.gz binary
|
|
67
|
-
*.tar binary
|
|
68
|
-
*.tgz binary
|
|
69
|
-
*.zip binary
|
|
70
|
-
|
|
71
|
-
# Text files where line endings should be preserved
|
|
72
|
-
*.patch -text
|
|
73
|
-
|
|
74
|
-
#
|
|
75
|
-
# Exclude files from exporting
|
|
76
|
-
#
|
|
77
|
-
|
|
78
|
-
.gitattributes export-ignore
|
|
79
|
-
.gitignore export-ignore
|
|
80
|
-
|
|
81
|
-
# Java sources
|
|
82
|
-
*.java text diff=java
|
|
83
|
-
*.gradle text diff=java
|
|
84
|
-
*.gradle.kts text diff=java
|
|
85
|
-
|
|
86
|
-
# These files are text and should be normalized (Convert crlf => lf)
|
|
87
|
-
*.css text diff=css
|
|
88
|
-
*.df text
|
|
89
|
-
*.htm text diff=html
|
|
90
|
-
*.html text diff=html
|
|
91
|
-
*.js text
|
|
92
|
-
*.jsp text
|
|
93
|
-
*.jspf text
|
|
94
|
-
*.jspx text
|
|
95
|
-
*.properties text
|
|
96
|
-
*.tld text
|
|
97
|
-
*.tag text
|
|
98
|
-
*.tagx text
|
|
99
|
-
*.xml text
|
|
100
|
-
|
|
101
|
-
# These files shouldn't be taken into account for statistics
|
|
102
|
-
# since they are from external libraries
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
# These files are binary and should be left untouched
|
|
106
|
-
# (binary is a macro for -text -diff)
|
|
107
|
-
*.class binary
|
|
108
|
-
*.dll binary
|
|
109
|
-
*.ear binary
|
|
110
|
-
*.jar binary
|
|
111
|
-
*.so binary
|
|
112
|
-
*.war binary
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="WEB_MODULE" version="4">
|
|
3
|
-
<component name="NewModuleRootManager">
|
|
4
|
-
<content url="file://$MODULE_DIR$">
|
|
5
|
-
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
|
6
|
-
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
|
7
|
-
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
|
8
|
-
<excludeFolder url="file://$MODULE_DIR$/docs" />
|
|
9
|
-
<excludeFolder url="file://$MODULE_DIR$/backup" />
|
|
10
|
-
<excludeFolder url="file://$MODULE_DIR$/lib" />
|
|
11
|
-
<excludeFolder url="file://$MODULE_DIR$/notes" />
|
|
12
|
-
<excludeFolder url="file://$MODULE_DIR$/umd" />
|
|
13
|
-
<excludeFolder url="file://$MODULE_DIR$/coverage" />
|
|
14
|
-
<excludeFolder url="file://$MODULE_DIR$/.vscode" />
|
|
15
|
-
</content>
|
|
16
|
-
<orderEntry type="inheritedJdk" />
|
|
17
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
18
|
-
</component>
|
|
19
|
-
</module>
|
package/.idea/misc.xml
DELETED
package/.idea/modules.xml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectModuleManager">
|
|
4
|
-
<modules>
|
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/data-structure-typed.iml" filepath="$PROJECT_DIR$/.idea/data-structure-typed.iml" />
|
|
6
|
-
</modules>
|
|
7
|
-
</component>
|
|
8
|
-
</project>
|
package/.idea/vcs.xml
DELETED
package/.prettierignore
DELETED
package/webpack.config.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
|
|
3
|
-
module.exports = [
|
|
4
|
-
{
|
|
5
|
-
mode:'production',
|
|
6
|
-
entry: './src/index.ts',
|
|
7
|
-
target: 'web',
|
|
8
|
-
output: {
|
|
9
|
-
filename: 'bundle.min.js',
|
|
10
|
-
path: path.resolve(__dirname, 'umd'),
|
|
11
|
-
library: 'dataStructureTyped',
|
|
12
|
-
libraryTarget: 'umd',
|
|
13
|
-
},
|
|
14
|
-
resolve: {
|
|
15
|
-
extensions: ['.ts', '.js'],
|
|
16
|
-
},
|
|
17
|
-
module: {
|
|
18
|
-
rules: [
|
|
19
|
-
{
|
|
20
|
-
test: /\.ts$/,
|
|
21
|
-
use: 'ts-loader',
|
|
22
|
-
exclude: /node_modules/,
|
|
23
|
-
}
|
|
24
|
-
],
|
|
25
|
-
},
|
|
26
|
-
devtool: 'source-map',
|
|
27
|
-
},
|
|
28
|
-
];
|