Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3901188

Browse files
chore(sorting): clean up variables
1 parent e5bd4b7 commit 3901188

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

‎src/runtimes/04-merge-sort.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@ const assert = require('assert');
1111
*/
1212
function merge(a = [], b = []) {
1313
const merged = [];
14-
let ai = 0;
15-
let bi = 0;
1614
// merge elements on a and b in asc order. Run-time O(a + b)
1715
for (let ai = 0, bi = 0; ai < a.length || bi < b.length;) {
18-
if(ai >= a.length || a[ai] > b[bi]) {
16+
if(ai >= a.length || a[ai] > b[bi]) {
1917
merged.push(b[bi++]);
2018
} else {
2119
merged.push(a[ai++]);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /