574138c7a3
* modify code to make use of java Optional class * revert changes * add java.util.Optional<Integer> * add java.util.Optional * refactors: make `findmajor` return `optional` * refactors: make method name findMajor and split it * refactors: change method name in tests * Apply suggestions from code review Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com> * change back to int * fix: swap arguments * tests: add some test cases * refactor: add `isMajority` and avoid rounding * style: use `var` * style: swap arguments of `countOccurrences` --------- Co-authored-by: vil02 <vil02@o2.pl> Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com> |
||
---|---|---|
.devcontainer | ||
.github | ||
src | ||
.clang-format | ||
.gitignore | ||
.gitpod.dockerfile | ||
.gitpod.yml | ||
CONTRIBUTING.md | ||
DIRECTORY.md | ||
LICENSE | ||
pom.xml | ||
README-ko.md | ||
README.md |
The Algorithms - Java
You can run and edit the algorithms, or contribute to them using Gitpod.io (a free online development environment) with a single click.
All algorithms are implemented in Java (for educational purposes)
These implementations are intended for learning purposes. As such, they may be less efficient than the Java standard library.
Contribution Guidelines
Please read our Contribution Guidelines before you contribute to this project.
Algorithms
Our directory has the full list of applications.