Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sortedMerge.js #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

annamatveev
Copy link

Shorter solution to the sortedMerge problem

Copy link
Collaborator

@profnandaa profnandaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for Anna your PR! 🎉

See my comment below.

In addition:

  1. Fix the formatting, 2 spaces for tab will be good -- and be consistent. We'll add a linter later to help with this.
  2. Instead of deleting the previous code, could your create a different file, e.g. sortedMerge-2.js

p1++;
}
else {
a.splice(p1,0,b[p2]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These slices might/will actually be expensive for large inputs; think about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants