Xolvez 6aa3314b93 fix: fixed error in the MaxProductOfThree algorithm (#1295)
* fix: fixed error in the MaxProductOfThree algorithm

Fixed the error in the MaxProductOfThree by initializing the max and min
variables to null instead of -1. The checks were then altered to check
for null instead of -1.

Also wrote more tests, which randomly generated small arrays and
compared the output of the maxProductOfThree-algorithm to the output of
a slower, but complete, function which calculates all posible
triple-products of the values of the array.

Fixes: #1294

* fix: Added newlines at the end of the files
2023-02-19 01:05:07 +05:30
2023-02-07 22:20:28 +05:30
2023-02-07 22:20:28 +05:30
2023-02-07 22:20:28 +05:30
2023-02-07 22:20:28 +05:30
2023-02-07 22:20:28 +05:30
2021-10-28 15:37:43 +05:30
2023-02-07 22:20:28 +05:30
2021-11-23 11:34:26 +05:30
2023-02-07 22:20:28 +05:30
2023-02-07 22:20:28 +05:30
2022-10-20 20:30:43 +05:30
2021-10-03 21:29:55 +05:30
2020-10-12 01:17:49 +05:30
2017-07-13 11:42:34 +05:30

The Algorithms - JavaScript

JavaScript Repository of TheAlgorithms, which implements various algorithms and data structures in JavaScript.

JavaScript Banner

Checks Contributions Welcome standard.js Discord chat


These implementations are for demonstrative purposes only. Dedicated implementations of these algorithms and data structures are much better for performance and security reasons. We also do not provide any guarantee for api stability.


Before contributing to this repository, make sure to read our Contribution Guidelines. You can look at other TheAlgorithms Repositories or the issues with a "help wanted" label for inspiration regarding what to implement. Our maintainers will guide you through how to make your contribution properly if you make any mistakes. The names of the maintainers of this repository are listed in the CODEOWNERS file.

You can find a list of the algorithms currently in the repository in the directory. Explanations of many of the algorithms can be found in the wiki.


Languages
JavaScript 100%