Skip to content

Commit e59c2d9

Browse files
committed
Fix indentation
1 parent 2b16896 commit e59c2d9

2 files changed

Lines changed: 49 additions & 49 deletions

File tree

‎src/searching/longest-increasing-subsequence.js‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -98,22 +98,22 @@
9898
return result;
9999
}
100100

101-
/**
102-
* Algorithm from dynamic programming. It finds the longest
103-
* sub-sequence of increasing numbers. It is not required
104-
* the numbers to be neighboring. For example for 1, 5, 2
105-
* sequence the longest sub-sequence is 1, 2.
106-
*
107-
* @example
108-
* var subsequence = require('path-to-algorithms/src/searching/'+
109-
* 'longest-increasing-subsequence').longestSubsequence;
110-
* console.log(subsequence([1, 0, 4, 3, 5])); // 1, 4, 5
111-
*
112-
* @public
113-
* @module searching/longest-increasing-subsequence
114-
* @param {Array} array Input sequence.
115-
* @return {Array} Longest increasing subsequence.
116-
*/
101+
/**
102+
* Algorithm from dynamic programming. It finds the longest
103+
* sub-sequence of increasing numbers. It is not required
104+
* the numbers to be neighboring. For example for 1, 5, 2
105+
* sequence the longest sub-sequence is 1, 2.
106+
*
107+
* @example
108+
* var subsequence = require('path-to-algorithms/src/searching/'+
109+
* 'longest-increasing-subsequence').longestSubsequence;
110+
* console.log(subsequence([1, 0, 4, 3, 5])); // 1, 4, 5
111+
*
112+
* @public
113+
* @module searching/longest-increasing-subsequence
114+
* @param {Array} array Input sequence.
115+
* @return {Array} Longest increasing subsequence.
116+
*/
117117
return function (array) {
118118
var results = [];
119119
var dag = buildDag(array);

‎src/sets/weightquickunion.js‎

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
(function (exports) {
2929
'use strict';
3030

31-
/**
32-
* Initialization.<br><br>
33-
* Time complexity: O(N).
34-
*
35-
* @public
36-
* @constructor
37-
* @param {Numner} size Count of the nodes.
38-
*/
31+
/**
32+
* Initialization.<br><br>
33+
* Time complexity: O(N).
34+
*
35+
* @public
36+
* @constructor
37+
* @param {Numner} size Count of the nodes.
38+
*/
3939
exports.QuickUnion = function (n) {
4040
this._ids = [];
4141
this._size = [];
@@ -45,42 +45,42 @@
4545
}
4646
};
4747

48-
/**
49-
* Finds the root of given node.<br><br>
50-
* Time complexity: O(log N).
51-
* @private
52-
* @param {Number} i The given node.
53-
* @return {Number} Root of the given node.
54-
*/
48+
/**
49+
* Finds the root of given node.<br><br>
50+
* Time complexity: O(log N).
51+
* @private
52+
* @param {Number} i The given node.
53+
* @return {Number} Root of the given node.
54+
*/
5555
exports.QuickUnion.prototype._root = function (i) {
5656
while (i !== this._ids[i]) {
57-
// this._ids[i] = this._ids[this._ids[i]]; //enables the path compression
57+
// this._ids[i] = this._ids[this._ids[i]]; //enables the path compression
5858
i = this._ids[i];
5959
}
6060
return i;
6161
};
6262

63-
/**
64-
* Checks whether two nodes are connected.<br><br>
65-
* Time complexity: O(log N).
66-
*
67-
* @param {Number} p The first node.
68-
* @param {Number} q The second node.
69-
* @return {Boolean} True/false depending on whether the nodes are connected.
70-
*/
63+
/**
64+
* Checks whether two nodes are connected.<br><br>
65+
* Time complexity: O(log N).
66+
*
67+
* @param {Number} p The first node.
68+
* @param {Number} q The second node.
69+
* @return {Boolean} True/false depending on whether the nodes are connected.
70+
*/
7171
exports.QuickUnion.prototype.connected = function (p, q) {
7272
return this._root(p) === this._root(q);
7373
};
7474

75-
/**
76-
* Connects two nodes - p and q.<br><br>
77-
* Time complexity: O(log N).
78-
*
79-
* @public
80-
* @method
81-
* @param {Number} p The first node.
82-
* @param {Number} q The second node.
83-
*/
75+
/**
76+
* Connects two nodes - p and q.<br><br>
77+
* Time complexity: O(log N).
78+
*
79+
* @public
80+
* @method
81+
* @param {Number} p The first node.
82+
* @param {Number} q The second node.
83+
*/
8484
exports.QuickUnion.prototype.union = function (p, q) {
8585
var pf = this._root(p);
8686
var qf = this._root(q);

0 commit comments

Comments
 (0)