min-heap-typed 1.39.4 → 1.39.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/dist/data-structures/graph/abstract-graph.d.ts +88 -88
- package/dist/data-structures/graph/abstract-graph.js +41 -41
- package/dist/data-structures/graph/directed-graph.d.ts +63 -63
- package/dist/data-structures/graph/directed-graph.js +36 -36
- package/dist/data-structures/graph/map-graph.d.ts +10 -10
- package/dist/data-structures/graph/map-graph.js +7 -7
- package/dist/data-structures/graph/undirected-graph.d.ts +38 -38
- package/dist/data-structures/graph/undirected-graph.js +21 -21
- package/dist/data-structures/queue/queue.d.ts +1 -1
- package/dist/data-structures/queue/queue.js +3 -3
- package/dist/interfaces/graph.d.ts +3 -3
- package/package.json +2 -2
- package/src/data-structures/graph/abstract-graph.ts +135 -133
- package/src/data-structures/graph/directed-graph.ts +92 -87
- package/src/data-structures/graph/map-graph.ts +17 -20
- package/src/data-structures/graph/undirected-graph.ts +56 -54
- package/src/data-structures/queue/queue.ts +1 -1
- package/src/interfaces/graph.ts +3 -3
|
@@ -11,7 +11,7 @@ export declare class UndirectedVertex<V = any> extends AbstractVertex<V> {
|
|
|
11
11
|
*/
|
|
12
12
|
constructor(key: VertexKey, val?: V);
|
|
13
13
|
}
|
|
14
|
-
export declare class UndirectedEdge<
|
|
14
|
+
export declare class UndirectedEdge<E = number> extends AbstractEdge<E> {
|
|
15
15
|
/**
|
|
16
16
|
* The constructor function creates an instance of a class with two vertex IDs, an optional weight, and an optional
|
|
17
17
|
* value.
|
|
@@ -19,21 +19,21 @@ export declare class UndirectedEdge<V = number> extends AbstractEdge<V> {
|
|
|
19
19
|
* @param {VertexKey} v2 - The parameter `v2` is a `VertexKey`, which represents the identifier of the second vertex in a
|
|
20
20
|
* graph edge.
|
|
21
21
|
* @param {number} [weight] - The weight parameter is an optional number that represents the weight of the edge.
|
|
22
|
-
* @param {
|
|
22
|
+
* @param {E} [val] - The "val" parameter is an optional parameter of type E. It is used to store a value associated
|
|
23
23
|
* with the edge.
|
|
24
24
|
*/
|
|
25
|
-
constructor(v1: VertexKey, v2: VertexKey, weight?: number, val?:
|
|
25
|
+
constructor(v1: VertexKey, v2: VertexKey, weight?: number, val?: E);
|
|
26
26
|
private _vertices;
|
|
27
27
|
get vertices(): [VertexKey, VertexKey];
|
|
28
28
|
set vertices(v: [VertexKey, VertexKey]);
|
|
29
29
|
}
|
|
30
|
-
export declare class UndirectedGraph<V extends UndirectedVertex<
|
|
30
|
+
export declare class UndirectedGraph<V = any, E = any, VO extends UndirectedVertex<V> = UndirectedVertex<V>, EO extends UndirectedEdge<E> = UndirectedEdge<E>> extends AbstractGraph<V, E, VO, EO> implements IGraph<V, E, VO, EO> {
|
|
31
31
|
/**
|
|
32
32
|
* The constructor initializes a new Map object to store edges.
|
|
33
33
|
*/
|
|
34
34
|
constructor();
|
|
35
|
-
protected _edges: Map<
|
|
36
|
-
get edges(): Map<
|
|
35
|
+
protected _edges: Map<VO, EO[]>;
|
|
36
|
+
get edges(): Map<VO, EO[]>;
|
|
37
37
|
/**
|
|
38
38
|
* The function creates a new vertex with an optional value and returns it.
|
|
39
39
|
* @param {VertexKey} key - The `key` parameter is the unique identifier for the vertex. It is used to distinguish one
|
|
@@ -41,9 +41,9 @@ export declare class UndirectedGraph<V extends UndirectedVertex<any> = Undirecte
|
|
|
41
41
|
* @param [val] - The `val` parameter is an optional value that can be assigned to the vertex. If a value is provided,
|
|
42
42
|
* it will be used as the value of the vertex. If no value is provided, the `key` parameter will be used as the value of
|
|
43
43
|
* the vertex.
|
|
44
|
-
* @returns The method is returning a new instance of the `UndirectedVertex` class, casted as type `
|
|
44
|
+
* @returns The method is returning a new instance of the `UndirectedVertex` class, casted as type `VO`.
|
|
45
45
|
*/
|
|
46
|
-
createVertex(key: VertexKey, val?:
|
|
46
|
+
createVertex(key: VertexKey, val?: VO['val']): VO;
|
|
47
47
|
/**
|
|
48
48
|
* The function creates an undirected edge between two vertices with an optional weight and value.
|
|
49
49
|
* @param {VertexKey} v1 - The parameter `v1` represents the first vertex of the edge.
|
|
@@ -52,76 +52,76 @@ export declare class UndirectedGraph<V extends UndirectedVertex<any> = Undirecte
|
|
|
52
52
|
* no weight is provided, it defaults to 1.
|
|
53
53
|
* @param [val] - The `val` parameter is an optional value that can be assigned to the edge. It can be of any type and
|
|
54
54
|
* is used to store additional information or data associated with the edge.
|
|
55
|
-
* @returns a new instance of the `UndirectedEdge` class, which is casted as type `
|
|
55
|
+
* @returns a new instance of the `UndirectedEdge` class, which is casted as type `EO`.
|
|
56
56
|
*/
|
|
57
|
-
createEdge(v1: VertexKey, v2: VertexKey, weight?: number, val?:
|
|
57
|
+
createEdge(v1: VertexKey, v2: VertexKey, weight?: number, val?: EO['val']): EO;
|
|
58
58
|
/**
|
|
59
59
|
* The function `getEdge` returns the first edge that connects two vertices, or null if no such edge exists.
|
|
60
|
-
* @param {
|
|
60
|
+
* @param {VO | null | VertexKey} v1 - The parameter `v1` represents a vertex or vertex ID. It can be of type `VO` (vertex
|
|
61
61
|
* object), `null`, or `VertexKey` (a string or number representing the ID of a vertex).
|
|
62
|
-
* @param {
|
|
62
|
+
* @param {VO | null | VertexKey} v2 - The parameter `v2` represents a vertex or vertex ID. It can be of type `VO` (vertex
|
|
63
63
|
* object), `null`, or `VertexKey` (vertex ID).
|
|
64
|
-
* @returns an edge (
|
|
64
|
+
* @returns an edge (EO) or null.
|
|
65
65
|
*/
|
|
66
|
-
getEdge(v1:
|
|
66
|
+
getEdge(v1: VO | null | VertexKey, v2: VO | null | VertexKey): EO | null;
|
|
67
67
|
/**
|
|
68
68
|
* The function removes an edge between two vertices in a graph and returns the removed edge.
|
|
69
|
-
* @param {
|
|
70
|
-
* @param {
|
|
69
|
+
* @param {VO | VertexKey} v1 - The parameter `v1` represents either a vertex object (`VO`) or a vertex ID (`VertexKey`).
|
|
70
|
+
* @param {VO | VertexKey} v2 - VO | VertexKey - This parameter can be either a vertex object (VO) or a vertex ID
|
|
71
71
|
* (VertexKey). It represents the second vertex of the edge that needs to be removed.
|
|
72
|
-
* @returns the removed edge (
|
|
72
|
+
* @returns the removed edge (EO) if it exists, or null if either of the vertices (VO) does not exist.
|
|
73
73
|
*/
|
|
74
|
-
deleteEdgeBetween(v1:
|
|
74
|
+
deleteEdgeBetween(v1: VO | VertexKey, v2: VO | VertexKey): EO | null;
|
|
75
75
|
/**
|
|
76
76
|
* The deleteEdge function removes an edge between two vertices in a graph.
|
|
77
|
-
* @param {
|
|
78
|
-
* @returns The method is returning either the removed edge (of type
|
|
77
|
+
* @param {EO} edge - The parameter "edge" is of type EO, which represents an edge in a graph.
|
|
78
|
+
* @returns The method is returning either the removed edge (of type EO) or null if the edge was not found.
|
|
79
79
|
*/
|
|
80
|
-
deleteEdge(edge:
|
|
80
|
+
deleteEdge(edge: EO): EO | null;
|
|
81
81
|
/**
|
|
82
82
|
* The function `degreeOf` returns the degree of a vertex in a graph, which is the number of edges connected to that
|
|
83
83
|
* vertex.
|
|
84
|
-
* @param {VertexKey |
|
|
84
|
+
* @param {VertexKey | VO} vertexOrKey - The parameter `vertexOrKey` can be either a `VertexKey` or a `VO`.
|
|
85
85
|
* @returns The function `degreeOf` returns the degree of a vertex in a graph. The degree of a vertex is the number of
|
|
86
86
|
* edges connected to that vertex.
|
|
87
87
|
*/
|
|
88
|
-
degreeOf(vertexOrKey: VertexKey |
|
|
88
|
+
degreeOf(vertexOrKey: VertexKey | VO): number;
|
|
89
89
|
/**
|
|
90
90
|
* The function returns the edges of a given vertex or vertex ID.
|
|
91
|
-
* @param {VertexKey |
|
|
92
|
-
* unique identifier for a vertex in a graph, while `
|
|
91
|
+
* @param {VertexKey | VO} vertexOrKey - The parameter `vertexOrKey` can be either a `VertexKey` or a `VO`. A `VertexKey` is a
|
|
92
|
+
* unique identifier for a vertex in a graph, while `VO` represents the type of the vertex.
|
|
93
93
|
* @returns an array of edges.
|
|
94
94
|
*/
|
|
95
|
-
edgesOf(vertexOrKey: VertexKey |
|
|
95
|
+
edgesOf(vertexOrKey: VertexKey | VO): EO[];
|
|
96
96
|
/**
|
|
97
97
|
* The function "edgeSet" returns an array of unique edges from a set of edges.
|
|
98
|
-
* @returns The method `edgeSet()` returns an array of type `
|
|
98
|
+
* @returns The method `edgeSet()` returns an array of type `EO[]`.
|
|
99
99
|
*/
|
|
100
|
-
edgeSet():
|
|
100
|
+
edgeSet(): EO[];
|
|
101
101
|
/**
|
|
102
102
|
* The function "getNeighbors" returns an array of neighboring vertices for a given vertex or vertex ID.
|
|
103
|
-
* @param {
|
|
103
|
+
* @param {VO | VertexKey} vertexOrKey - The parameter `vertexOrKey` can be either a vertex object (`VO`) or a vertex ID
|
|
104
104
|
* (`VertexKey`).
|
|
105
|
-
* @returns an array of vertices (
|
|
105
|
+
* @returns an array of vertices (VO[]).
|
|
106
106
|
*/
|
|
107
|
-
getNeighbors(vertexOrKey:
|
|
107
|
+
getNeighbors(vertexOrKey: VO | VertexKey): VO[];
|
|
108
108
|
/**
|
|
109
109
|
* The function "getEndsOfEdge" returns the vertices at the ends of an edge if the edge exists in the graph, otherwise
|
|
110
110
|
* it returns null.
|
|
111
|
-
* @param {
|
|
112
|
-
* @returns The function `getEndsOfEdge` returns an array containing two vertices `[
|
|
111
|
+
* @param {EO} edge - The parameter "edge" is of type EO, which represents an edge in a graph.
|
|
112
|
+
* @returns The function `getEndsOfEdge` returns an array containing two vertices `[VO, VO]` if the edge exists in the
|
|
113
113
|
* graph. If the edge does not exist, it returns `null`.
|
|
114
114
|
*/
|
|
115
|
-
getEndsOfEdge(edge:
|
|
115
|
+
getEndsOfEdge(edge: EO): [VO, VO] | null;
|
|
116
116
|
/**
|
|
117
117
|
* The function adds an edge to the graph by updating the adjacency list with the vertices of the edge.
|
|
118
|
-
* @param {
|
|
118
|
+
* @param {EO} edge - The parameter "edge" is of type EO, which represents an edge in a graph.
|
|
119
119
|
* @returns a boolean value.
|
|
120
120
|
*/
|
|
121
|
-
protected _addEdgeOnly(edge:
|
|
121
|
+
protected _addEdgeOnly(edge: EO): boolean;
|
|
122
122
|
/**
|
|
123
123
|
* The function sets the edges of a graph.
|
|
124
|
-
* @param v - A map where the keys are of type
|
|
124
|
+
* @param v - A map where the keys are of type VO and the values are arrays of type EO.
|
|
125
125
|
*/
|
|
126
|
-
protected _setEdges(v: Map<
|
|
126
|
+
protected _setEdges(v: Map<VO, EO[]>): void;
|
|
127
127
|
}
|
|
@@ -31,7 +31,7 @@ class UndirectedEdge extends abstract_graph_1.AbstractEdge {
|
|
|
31
31
|
* @param {VertexKey} v2 - The parameter `v2` is a `VertexKey`, which represents the identifier of the second vertex in a
|
|
32
32
|
* graph edge.
|
|
33
33
|
* @param {number} [weight] - The weight parameter is an optional number that represents the weight of the edge.
|
|
34
|
-
* @param {
|
|
34
|
+
* @param {E} [val] - The "val" parameter is an optional parameter of type E. It is used to store a value associated
|
|
35
35
|
* with the edge.
|
|
36
36
|
*/
|
|
37
37
|
constructor(v1, v2, weight, val) {
|
|
@@ -64,7 +64,7 @@ class UndirectedGraph extends abstract_graph_1.AbstractGraph {
|
|
|
64
64
|
* @param [val] - The `val` parameter is an optional value that can be assigned to the vertex. If a value is provided,
|
|
65
65
|
* it will be used as the value of the vertex. If no value is provided, the `key` parameter will be used as the value of
|
|
66
66
|
* the vertex.
|
|
67
|
-
* @returns The method is returning a new instance of the `UndirectedVertex` class, casted as type `
|
|
67
|
+
* @returns The method is returning a new instance of the `UndirectedVertex` class, casted as type `VO`.
|
|
68
68
|
*/
|
|
69
69
|
createVertex(key, val) {
|
|
70
70
|
return new UndirectedVertex(key, val !== null && val !== void 0 ? val : key);
|
|
@@ -77,18 +77,18 @@ class UndirectedGraph extends abstract_graph_1.AbstractGraph {
|
|
|
77
77
|
* no weight is provided, it defaults to 1.
|
|
78
78
|
* @param [val] - The `val` parameter is an optional value that can be assigned to the edge. It can be of any type and
|
|
79
79
|
* is used to store additional information or data associated with the edge.
|
|
80
|
-
* @returns a new instance of the `UndirectedEdge` class, which is casted as type `
|
|
80
|
+
* @returns a new instance of the `UndirectedEdge` class, which is casted as type `EO`.
|
|
81
81
|
*/
|
|
82
82
|
createEdge(v1, v2, weight, val) {
|
|
83
83
|
return new UndirectedEdge(v1, v2, weight !== null && weight !== void 0 ? weight : 1, val);
|
|
84
84
|
}
|
|
85
85
|
/**
|
|
86
86
|
* The function `getEdge` returns the first edge that connects two vertices, or null if no such edge exists.
|
|
87
|
-
* @param {
|
|
87
|
+
* @param {VO | null | VertexKey} v1 - The parameter `v1` represents a vertex or vertex ID. It can be of type `VO` (vertex
|
|
88
88
|
* object), `null`, or `VertexKey` (a string or number representing the ID of a vertex).
|
|
89
|
-
* @param {
|
|
89
|
+
* @param {VO | null | VertexKey} v2 - The parameter `v2` represents a vertex or vertex ID. It can be of type `VO` (vertex
|
|
90
90
|
* object), `null`, or `VertexKey` (vertex ID).
|
|
91
|
-
* @returns an edge (
|
|
91
|
+
* @returns an edge (EO) or null.
|
|
92
92
|
*/
|
|
93
93
|
getEdge(v1, v2) {
|
|
94
94
|
var _a;
|
|
@@ -104,10 +104,10 @@ class UndirectedGraph extends abstract_graph_1.AbstractGraph {
|
|
|
104
104
|
}
|
|
105
105
|
/**
|
|
106
106
|
* The function removes an edge between two vertices in a graph and returns the removed edge.
|
|
107
|
-
* @param {
|
|
108
|
-
* @param {
|
|
107
|
+
* @param {VO | VertexKey} v1 - The parameter `v1` represents either a vertex object (`VO`) or a vertex ID (`VertexKey`).
|
|
108
|
+
* @param {VO | VertexKey} v2 - VO | VertexKey - This parameter can be either a vertex object (VO) or a vertex ID
|
|
109
109
|
* (VertexKey). It represents the second vertex of the edge that needs to be removed.
|
|
110
|
-
* @returns the removed edge (
|
|
110
|
+
* @returns the removed edge (EO) if it exists, or null if either of the vertices (VO) does not exist.
|
|
111
111
|
*/
|
|
112
112
|
deleteEdgeBetween(v1, v2) {
|
|
113
113
|
const vertex1 = this._getVertex(v1);
|
|
@@ -128,8 +128,8 @@ class UndirectedGraph extends abstract_graph_1.AbstractGraph {
|
|
|
128
128
|
}
|
|
129
129
|
/**
|
|
130
130
|
* The deleteEdge function removes an edge between two vertices in a graph.
|
|
131
|
-
* @param {
|
|
132
|
-
* @returns The method is returning either the removed edge (of type
|
|
131
|
+
* @param {EO} edge - The parameter "edge" is of type EO, which represents an edge in a graph.
|
|
132
|
+
* @returns The method is returning either the removed edge (of type EO) or null if the edge was not found.
|
|
133
133
|
*/
|
|
134
134
|
deleteEdge(edge) {
|
|
135
135
|
return this.deleteEdgeBetween(edge.vertices[0], edge.vertices[1]);
|
|
@@ -137,7 +137,7 @@ class UndirectedGraph extends abstract_graph_1.AbstractGraph {
|
|
|
137
137
|
/**
|
|
138
138
|
* The function `degreeOf` returns the degree of a vertex in a graph, which is the number of edges connected to that
|
|
139
139
|
* vertex.
|
|
140
|
-
* @param {VertexKey |
|
|
140
|
+
* @param {VertexKey | VO} vertexOrKey - The parameter `vertexOrKey` can be either a `VertexKey` or a `VO`.
|
|
141
141
|
* @returns The function `degreeOf` returns the degree of a vertex in a graph. The degree of a vertex is the number of
|
|
142
142
|
* edges connected to that vertex.
|
|
143
143
|
*/
|
|
@@ -153,8 +153,8 @@ class UndirectedGraph extends abstract_graph_1.AbstractGraph {
|
|
|
153
153
|
}
|
|
154
154
|
/**
|
|
155
155
|
* The function returns the edges of a given vertex or vertex ID.
|
|
156
|
-
* @param {VertexKey |
|
|
157
|
-
* unique identifier for a vertex in a graph, while `
|
|
156
|
+
* @param {VertexKey | VO} vertexOrKey - The parameter `vertexOrKey` can be either a `VertexKey` or a `VO`. A `VertexKey` is a
|
|
157
|
+
* unique identifier for a vertex in a graph, while `VO` represents the type of the vertex.
|
|
158
158
|
* @returns an array of edges.
|
|
159
159
|
*/
|
|
160
160
|
edgesOf(vertexOrKey) {
|
|
@@ -168,7 +168,7 @@ class UndirectedGraph extends abstract_graph_1.AbstractGraph {
|
|
|
168
168
|
}
|
|
169
169
|
/**
|
|
170
170
|
* The function "edgeSet" returns an array of unique edges from a set of edges.
|
|
171
|
-
* @returns The method `edgeSet()` returns an array of type `
|
|
171
|
+
* @returns The method `edgeSet()` returns an array of type `EO[]`.
|
|
172
172
|
*/
|
|
173
173
|
edgeSet() {
|
|
174
174
|
const edgeSet = new Set();
|
|
@@ -181,9 +181,9 @@ class UndirectedGraph extends abstract_graph_1.AbstractGraph {
|
|
|
181
181
|
}
|
|
182
182
|
/**
|
|
183
183
|
* The function "getNeighbors" returns an array of neighboring vertices for a given vertex or vertex ID.
|
|
184
|
-
* @param {
|
|
184
|
+
* @param {VO | VertexKey} vertexOrKey - The parameter `vertexOrKey` can be either a vertex object (`VO`) or a vertex ID
|
|
185
185
|
* (`VertexKey`).
|
|
186
|
-
* @returns an array of vertices (
|
|
186
|
+
* @returns an array of vertices (VO[]).
|
|
187
187
|
*/
|
|
188
188
|
getNeighbors(vertexOrKey) {
|
|
189
189
|
const neighbors = [];
|
|
@@ -202,8 +202,8 @@ class UndirectedGraph extends abstract_graph_1.AbstractGraph {
|
|
|
202
202
|
/**
|
|
203
203
|
* The function "getEndsOfEdge" returns the vertices at the ends of an edge if the edge exists in the graph, otherwise
|
|
204
204
|
* it returns null.
|
|
205
|
-
* @param {
|
|
206
|
-
* @returns The function `getEndsOfEdge` returns an array containing two vertices `[
|
|
205
|
+
* @param {EO} edge - The parameter "edge" is of type EO, which represents an edge in a graph.
|
|
206
|
+
* @returns The function `getEndsOfEdge` returns an array containing two vertices `[VO, VO]` if the edge exists in the
|
|
207
207
|
* graph. If the edge does not exist, it returns `null`.
|
|
208
208
|
*/
|
|
209
209
|
getEndsOfEdge(edge) {
|
|
@@ -221,7 +221,7 @@ class UndirectedGraph extends abstract_graph_1.AbstractGraph {
|
|
|
221
221
|
}
|
|
222
222
|
/**
|
|
223
223
|
* The function adds an edge to the graph by updating the adjacency list with the vertices of the edge.
|
|
224
|
-
* @param {
|
|
224
|
+
* @param {EO} edge - The parameter "edge" is of type EO, which represents an edge in a graph.
|
|
225
225
|
* @returns a boolean value.
|
|
226
226
|
*/
|
|
227
227
|
_addEdgeOnly(edge) {
|
|
@@ -243,7 +243,7 @@ class UndirectedGraph extends abstract_graph_1.AbstractGraph {
|
|
|
243
243
|
}
|
|
244
244
|
/**
|
|
245
245
|
* The function sets the edges of a graph.
|
|
246
|
-
* @param v - A map where the keys are of type
|
|
246
|
+
* @param v - A map where the keys are of type VO and the values are arrays of type EO.
|
|
247
247
|
*/
|
|
248
248
|
_setEdges(v) {
|
|
249
249
|
this._edges = v;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @class
|
|
5
5
|
*/
|
|
6
6
|
import { SinglyLinkedList } from '../linked-list';
|
|
7
|
-
export declare class
|
|
7
|
+
export declare class SkipQueue<E = any> extends SinglyLinkedList<E> {
|
|
8
8
|
/**
|
|
9
9
|
* The enqueue function adds a value to the end of an array.
|
|
10
10
|
* @param {E} value - The value parameter represents the value that you want to add to the queue.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Queue = exports.
|
|
3
|
+
exports.Queue = exports.SkipQueue = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* @license MIT
|
|
6
6
|
* @copyright Tyler Zeng <zrwusa@gmail.com>
|
|
7
7
|
* @class
|
|
8
8
|
*/
|
|
9
9
|
const linked_list_1 = require("../linked-list");
|
|
10
|
-
class
|
|
10
|
+
class SkipQueue extends linked_list_1.SinglyLinkedList {
|
|
11
11
|
/**
|
|
12
12
|
* The enqueue function adds a value to the end of an array.
|
|
13
13
|
* @param {E} value - The value parameter represents the value that you want to add to the queue.
|
|
@@ -31,7 +31,7 @@ class LinkedListQueue extends linked_list_1.SinglyLinkedList {
|
|
|
31
31
|
return (_a = this.head) === null || _a === void 0 ? void 0 : _a.val;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
exports.
|
|
34
|
+
exports.SkipQueue = SkipQueue;
|
|
35
35
|
class Queue {
|
|
36
36
|
/**
|
|
37
37
|
* The constructor initializes an instance of a class with an optional array of elements and sets the offset to 0.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VertexKey } from '../types';
|
|
2
|
-
export interface IGraph<V, E> {
|
|
3
|
-
createVertex(key: VertexKey, val?: V):
|
|
4
|
-
createEdge(srcOrV1: VertexKey | string, destOrV2: VertexKey | string, weight?: number, val?: E):
|
|
2
|
+
export interface IGraph<V, E, VO, EO> {
|
|
3
|
+
createVertex(key: VertexKey, val?: V): VO;
|
|
4
|
+
createEdge(srcOrV1: VertexKey | string, destOrV2: VertexKey | string, weight?: number, val?: E): EO;
|
|
5
5
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "min-heap-typed",
|
|
3
|
-
"version": "1.39.
|
|
3
|
+
"version": "1.39.5",
|
|
4
4
|
"description": "Min Heap. Javascript & Typescript Data Structure.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -131,6 +131,6 @@
|
|
|
131
131
|
"typescript": "^4.9.5"
|
|
132
132
|
},
|
|
133
133
|
"dependencies": {
|
|
134
|
-
"data-structure-typed": "^1.39.
|
|
134
|
+
"data-structure-typed": "^1.39.5"
|
|
135
135
|
}
|
|
136
136
|
}
|