Skip to content

Commit 98b5b4a

Browse files
author
AndreyGeonya
committed
fix quickfind jsdoc
1 parent 89f0caa commit 98b5b4a

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

‎src/sets/quickfind.js‎

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/**
22
* Keeps track of a set of elements partitioned into a
33
* number of disjoint (nonoverlapping) subsets.
4+
* Allows to check whether the path between two nodes exists.
45
*
56
* @example
67
*
@@ -26,24 +27,27 @@
2627
* Initialization.<br><br>
2728
* Complexity: O(N).
2829
*
30+
* @public
2931
* @constructor
3032
* @param {Numner} size Count of the nodes.
3133
*/
32-
function QuickFind(size) {
34+
exports.QuickFind = function (size) {
3335
this._ids = [];
3436
for (var i = 0; i < size; i += 1) {
3537
this._ids[i] = i;
3638
}
37-
}
39+
};
3840

3941
/**
4042
* Connects two nodes - p and q.<br><br>
4143
* Complexity: O(N).
4244
*
45+
* @public
46+
* @method
4347
* @param {Number} p The first node.
4448
* @param {Number} q The second node.
4549
*/
46-
QuickFind.prototype.union = function (p, q) {
50+
exports.QuickFind.prototype.union = function (p, q) {
4751
var size = this._ids.length;
4852
var pval = this._ids[p];
4953
var qval = this._ids[q];
@@ -58,14 +62,14 @@
5862
* Checks whether two nodes are connected.<br><br>
5963
* Complexity: O(1).
6064
*
61-
* @param {number} p The first node.
62-
* @param {number} q The second node.
63-
*
65+
* @public
66+
* @method
67+
* @param {Number} p The first node.
68+
* @param {Number} q The second node.
69+
* @return {Boolean}
6470
*/
65-
QuickFind.prototype.connected = function (p, q) {
71+
exports.QuickFind.prototype.connected = function (p, q) {
6672
return this._ids[p] === this._ids[q];
6773
};
6874

69-
exports.QuickFind = QuickFind;
70-
7175
})(typeof window === 'undefined' ? module.exports : window);

0 commit comments

Comments
 (0)