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

Add JavaScript for linear search #157

Merged
merged 7 commits into from Dec 22, 2022
Merged

Add JavaScript for linear search #157

merged 7 commits into from Dec 22, 2022

Conversation

JoseHung
Copy link
Contributor

@JoseHung JoseHung commented Dec 22, 2022

Checklist

  • I've tested the code and ensured the outputs are the same as the outputs of reference codes.
  • I've checked the codes (formatting, comments, indentation, file header, etc) carefully.
  • The code does not rely on a particular environment or IDE and can be executed on a standard system (Win, macOS, Ubuntu).

I also fixed a error of making assignment to the constant variable in the ListNode.js.

@vercel
Copy link

vercel bot commented Dec 22, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
hello-algo ⬜️ Ignored (Inspect) Dec 22, 2022 at 5:17PM (UTC)

Copy link
Owner

@krahets krahets left a comment

Choose a reason for hiding this comment

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

Thank @JoseHung for the addition and the fixing! There are several comments to be addressed.

@@ -337,7 +369,8 @@ $$
=== "JavaScript"

```js title=""

// JavaScript 中的数字足够大(最大数值为 1.7976931348623157e+308 )
Copy link
Owner

@krahets krahets Dec 22, 2022

Choose a reason for hiding this comment

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

My bad, 1.7976931348623157e+308 is not infinite, so we still have to handle the big-number problem. I'll update the code. @JoseHung

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hahaha. Actually I think both of the explanations are reasonable.

Copy link
Owner

Choose a reason for hiding this comment

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

Yes, apparently we won't reach 1.7976931348623157e+308 in most cases. 😄

Copy link
Owner

@krahets krahets 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 the update! Now merge it.

@krahets krahets merged commit ee6842d into krahets:master Dec 22, 2022
@krahets krahets added the code Code-related label Dec 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code Code-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants