Skip to content

Commit fd6ce51

Browse files
committed
Update docs
1 parent 2a721a7 commit fd6ce51

File tree

43 files changed

+1201
-152
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1201
-152
lines changed

data-structures_binary-search-tree.js.html

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,8 @@ <h1 class="page-title">Source: data-structures/binary-search-tree.js</h1>
282282
}
283283

284284
if (node._left &amp;&amp; node._right) {
285-
var min = this._findMin(node._right),
286-
temp = node.value;
285+
var min = this._findMin(node._right);
286+
var temp = node.value;
287287

288288
node.value = min.value;
289289
min.value = temp;
@@ -390,9 +390,9 @@ <h1 class="page-title">Source: data-structures/binary-search-tree.js</h1>
390390
if (!root) {
391391
return 0;
392392
}
393-
var leftHeight = this._getHeight(root._left),
394-
rightHeight = this._getHeight(root._right),
395-
path = leftHeight + rightHeight + 1;
393+
var leftHeight = this._getHeight(root._left);
394+
var rightHeight = this._getHeight(root._right);
395+
var path = leftHeight + rightHeight + 1;
396396
return Math.max(path, getDiameter(root._left), getDiameter(root._right));
397397
}.bind(this);
398398
return getDiameter(this._root);
@@ -429,10 +429,10 @@ <h1 class="page-title">Source: data-structures/binary-search-tree.js</h1>
429429

430430
exports.BinaryTree.prototype._lowestCommonAncestor =
431431
function (firstNode, secondNode, current) {
432-
var firstNodeInLeft = this._existsInSubtree(firstNode, current._left),
433-
secondNodeInLeft = this._existsInSubtree(secondNode, current._left),
434-
firstNodeInRight = this._existsInSubtree(firstNode, current._right),
435-
secondNodeInRight = this._existsInSubtree(secondNode, current._right);
432+
var firstNodeInLeft = this._existsInSubtree(firstNode, current._left);
433+
var secondNodeInLeft = this._existsInSubtree(secondNode, current._left);
434+
var firstNodeInRight = this._existsInSubtree(firstNode, current._right);
435+
var secondNodeInRight = this._existsInSubtree(secondNode, current._right);
436436
if ((firstNodeInLeft &amp;&amp; secondNodeInRight) ||
437437
(firstNodeInRight &amp;&amp; secondNodeInLeft)) {
438438
return current;
@@ -457,7 +457,8 @@ <h1 class="page-title">Source: data-structures/binary-search-tree.js</h1>
457457
this._existsInSubtree(node, root._right);
458458
};
459459

460-
})(typeof window === 'undefined' ? module.exports : window);</code></pre>
460+
})(typeof window === 'undefined' ? module.exports : window);
461+
</code></pre>
461462
</article>
462463
</section>
463464

@@ -467,13 +468,13 @@ <h1 class="page-title">Source: data-structures/binary-search-tree.js</h1>
467468
</div>
468469

469470
<nav>
470-
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-data-structures_binary-search-tree.html">data-structures/binary-search-tree</a></li><li><a href="module-data-structures_heap.html">data-structures/heap</a></li><li><a href="module-data-structures_interval-tree.html">data-structures/interval-tree</a></li><li><a href="module-data-structures_linked-list.html">data-structures/linked-list</a></li><li><a href="module-data-structures_red-black-tree.html">data-structures/red-black-tree</a></li><li><a href="module-graphs_others_topological-sort.html">graphs/others/topological-sort</a></li><li><a href="module-graphs_searching_bfs.html">graphs/searching/bfs</a></li><li><a href="module-graphs_searching_dfs.html">graphs/searching/dfs</a></li><li><a href="module-graphs_shortest-path_bellman-ford.html">graphs/shortest-path/bellman-ford</a></li><li><a href="module-graphs_shortest-path_dijkstra.html">graphs/shortest-path/dijkstra</a></li><li><a href="module-graphs_shortest-path_floyd-warshall.html">graphs/shortest-path/floyd-warshall</a></li><li><a href="module-graphs_spanning-trees_prim.html">graphs/spanning-trees/prim</a></li></ul><h3>Classes</h3><ul><li><a href="module-data-structures_binary-search-tree.BinaryTree.html">BinaryTree</a></li><li><a href="module-data-structures_binary-search-tree.Node.html">Node</a></li><li><a href="module-data-structures_heap.Heap.html">Heap</a></li><li><a href="module-data-structures_interval-tree.IntervalTree.html">IntervalTree</a></li><li><a href="module-data-structures_interval-tree.Node.html">Node</a></li><li><a href="module-data-structures_linked-list.LinkedList.html">LinkedList</a></li><li><a href="module-data-structures_linked-list.Node.html">Node</a></li><li><a href="module-data-structures_red-black-tree.RBTree.html">RBTree</a></li><li><a href="module-graphs_shortest-path_bellman-ford.Edge.html">Edge</a></li><li><a href="module-graphs_spanning-trees_prim.Edge.html">Edge</a></li><li><a href="module-graphs_spanning-trees_prim.Graph.html">Graph</a></li><li><a href="module-graphs_spanning-trees_prim.Vertex.html">Vertex</a></li></ul>
471+
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-data-structures_binary-search-tree.html">data-structures/binary-search-tree</a></li><li><a href="module-data-structures_heap.html">data-structures/heap</a></li><li><a href="module-data-structures_interval-tree.html">data-structures/interval-tree</a></li><li><a href="module-data-structures_linked-list.html">data-structures/linked-list</a></li><li><a href="module-data-structures_red-black-tree.html">data-structures/red-black-tree</a></li><li><a href="module-graphs_others_topological-sort.html">graphs/others/topological-sort</a></li><li><a href="module-graphs_searching_bfs.html">graphs/searching/bfs</a></li><li><a href="module-graphs_searching_dfs.html">graphs/searching/dfs</a></li><li><a href="module-graphs_shortest-path_bellman-ford.html">graphs/shortest-path/bellman-ford</a></li><li><a href="module-graphs_shortest-path_dijkstra.html">graphs/shortest-path/dijkstra</a></li><li><a href="module-graphs_shortest-path_floyd-warshall.html">graphs/shortest-path/floyd-warshall</a></li><li><a href="module-graphs_spanning-trees_prim.html">graphs/spanning-trees/prim</a></li><li><a href="module-primes_is-prime.html">primes/is-prime</a></li><li><a href="module-primes_prime-factor-tree.html">primes/prime-factor-tree</a></li><li><a href="module-primes_sieve-of-eratosthenes.html">primes/sieve-of-eratosthenes</a></li></ul><h3>Classes</h3><ul><li><a href="module-data-structures_binary-search-tree.BinaryTree.html">BinaryTree</a></li><li><a href="module-data-structures_binary-search-tree.Node.html">Node</a></li><li><a href="module-data-structures_heap.Heap.html">Heap</a></li><li><a href="module-data-structures_interval-tree.IntervalTree.html">IntervalTree</a></li><li><a href="module-data-structures_interval-tree.Node.html">Node</a></li><li><a href="module-data-structures_linked-list.LinkedList.html">LinkedList</a></li><li><a href="module-data-structures_linked-list.Node.html">Node</a></li><li><a href="module-data-structures_red-black-tree.RBTree.html">RBTree</a></li><li><a href="module-graphs_shortest-path_bellman-ford.Edge.html">Edge</a></li><li><a href="module-graphs_spanning-trees_prim.Edge.html">Edge</a></li><li><a href="module-graphs_spanning-trees_prim.Graph.html">Graph</a></li><li><a href="module-graphs_spanning-trees_prim.Vertex.html">Vertex</a></li></ul>
471472
</nav>
472473

473474
<br class="clear">
474475

475476
<footer>
476-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha13</a> on Sun Jan 11 2015 16:51:38 GMT+0200 (EET)
477+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha13</a> on Sun Jan 11 2015 19:06:09 GMT+0200 (EET)
477478
</footer>
478479

479480
<script> prettyPrint(); </script>

data-structures_heap.js.html

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ <h1 class="page-title">Source: data-structures/heap.js</h1>
9999
* @param {Number} index The parent.
100100
*/
101101
exports.Heap.prototype._heapify = function (index) {
102-
var extr = index,
103-
left = 2 * index + 1,
104-
right = 2 * index + 2,
105-
temp;
102+
var extr = index;
103+
var left = 2 * index + 1;
104+
var right = 2 * index + 2;
105+
var temp;
106106

107107
if (left &lt; this._heap.length &amp;&amp;
108108
this._cmp(this._heap[left], this._heap[index]) > 0) {
@@ -133,9 +133,9 @@ <h1 class="page-title">Source: data-structures/heap.js</h1>
133133
*/
134134
exports.Heap.prototype.changeKey = function (index, value) {
135135
this._heap[index] = value;
136-
var elem = this._heap[index],
137-
parent = Math.floor(index / 2),
138-
temp;
136+
var elem = this._heap[index];
137+
var parent = Math.floor(index / 2);
138+
var temp;
139139
if (elem !== undefined) {
140140
while (parent >= 0 &amp;&amp; this._cmp(elem, this._heap[parent]) > 0) {
141141
temp = this._heap[parent];
@@ -218,7 +218,8 @@ <h1 class="page-title">Source: data-structures/heap.js</h1>
218218
return !this._heap.length;
219219
};
220220

221-
})(typeof window === 'undefined' ? module.exports : window);</code></pre>
221+
})(typeof window === 'undefined' ? module.exports : window);
222+
</code></pre>
222223
</article>
223224
</section>
224225

@@ -228,13 +229,13 @@ <h1 class="page-title">Source: data-structures/heap.js</h1>
228229
</div>
229230

230231
<nav>
231-
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-data-structures_binary-search-tree.html">data-structures/binary-search-tree</a></li><li><a href="module-data-structures_heap.html">data-structures/heap</a></li><li><a href="module-data-structures_interval-tree.html">data-structures/interval-tree</a></li><li><a href="module-data-structures_linked-list.html">data-structures/linked-list</a></li><li><a href="module-data-structures_red-black-tree.html">data-structures/red-black-tree</a></li><li><a href="module-graphs_others_topological-sort.html">graphs/others/topological-sort</a></li><li><a href="module-graphs_searching_bfs.html">graphs/searching/bfs</a></li><li><a href="module-graphs_searching_dfs.html">graphs/searching/dfs</a></li><li><a href="module-graphs_shortest-path_bellman-ford.html">graphs/shortest-path/bellman-ford</a></li><li><a href="module-graphs_shortest-path_dijkstra.html">graphs/shortest-path/dijkstra</a></li><li><a href="module-graphs_shortest-path_floyd-warshall.html">graphs/shortest-path/floyd-warshall</a></li><li><a href="module-graphs_spanning-trees_prim.html">graphs/spanning-trees/prim</a></li></ul><h3>Classes</h3><ul><li><a href="module-data-structures_binary-search-tree.BinaryTree.html">BinaryTree</a></li><li><a href="module-data-structures_binary-search-tree.Node.html">Node</a></li><li><a href="module-data-structures_heap.Heap.html">Heap</a></li><li><a href="module-data-structures_interval-tree.IntervalTree.html">IntervalTree</a></li><li><a href="module-data-structures_interval-tree.Node.html">Node</a></li><li><a href="module-data-structures_linked-list.LinkedList.html">LinkedList</a></li><li><a href="module-data-structures_linked-list.Node.html">Node</a></li><li><a href="module-data-structures_red-black-tree.RBTree.html">RBTree</a></li><li><a href="module-graphs_shortest-path_bellman-ford.Edge.html">Edge</a></li><li><a href="module-graphs_spanning-trees_prim.Edge.html">Edge</a></li><li><a href="module-graphs_spanning-trees_prim.Graph.html">Graph</a></li><li><a href="module-graphs_spanning-trees_prim.Vertex.html">Vertex</a></li></ul>
232+
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-data-structures_binary-search-tree.html">data-structures/binary-search-tree</a></li><li><a href="module-data-structures_heap.html">data-structures/heap</a></li><li><a href="module-data-structures_interval-tree.html">data-structures/interval-tree</a></li><li><a href="module-data-structures_linked-list.html">data-structures/linked-list</a></li><li><a href="module-data-structures_red-black-tree.html">data-structures/red-black-tree</a></li><li><a href="module-graphs_others_topological-sort.html">graphs/others/topological-sort</a></li><li><a href="module-graphs_searching_bfs.html">graphs/searching/bfs</a></li><li><a href="module-graphs_searching_dfs.html">graphs/searching/dfs</a></li><li><a href="module-graphs_shortest-path_bellman-ford.html">graphs/shortest-path/bellman-ford</a></li><li><a href="module-graphs_shortest-path_dijkstra.html">graphs/shortest-path/dijkstra</a></li><li><a href="module-graphs_shortest-path_floyd-warshall.html">graphs/shortest-path/floyd-warshall</a></li><li><a href="module-graphs_spanning-trees_prim.html">graphs/spanning-trees/prim</a></li><li><a href="module-primes_is-prime.html">primes/is-prime</a></li><li><a href="module-primes_prime-factor-tree.html">primes/prime-factor-tree</a></li><li><a href="module-primes_sieve-of-eratosthenes.html">primes/sieve-of-eratosthenes</a></li></ul><h3>Classes</h3><ul><li><a href="module-data-structures_binary-search-tree.BinaryTree.html">BinaryTree</a></li><li><a href="module-data-structures_binary-search-tree.Node.html">Node</a></li><li><a href="module-data-structures_heap.Heap.html">Heap</a></li><li><a href="module-data-structures_interval-tree.IntervalTree.html">IntervalTree</a></li><li><a href="module-data-structures_interval-tree.Node.html">Node</a></li><li><a href="module-data-structures_linked-list.LinkedList.html">LinkedList</a></li><li><a href="module-data-structures_linked-list.Node.html">Node</a></li><li><a href="module-data-structures_red-black-tree.RBTree.html">RBTree</a></li><li><a href="module-graphs_shortest-path_bellman-ford.Edge.html">Edge</a></li><li><a href="module-graphs_spanning-trees_prim.Edge.html">Edge</a></li><li><a href="module-graphs_spanning-trees_prim.Graph.html">Graph</a></li><li><a href="module-graphs_spanning-trees_prim.Vertex.html">Vertex</a></li></ul>
232233
</nav>
233234

234235
<br class="clear">
235236

236237
<footer>
237-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha13</a> on Sun Jan 11 2015 16:51:38 GMT+0200 (EET)
238+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha13</a> on Sun Jan 11 2015 19:06:09 GMT+0200 (EET)
238239
</footer>
239240

240241
<script> prettyPrint(); </script>

0 commit comments

Comments
 (0)