419 Commits

Author SHA1 Message Date
414835db11 style: enable AvoidStarImport in checkstyle (#5141) 2024-05-05 20:48:56 +02:00
dc47e0aa42 style: include ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD (#5129) 2024-05-05 18:39:26 +00:00
5d00889291 fix: handle empty inputs in CircleSort (#5121)
* fix: handle empty inputs in `CircleSort`

* style: remove `main` method
2024-05-05 23:56:54 +05:30
dda3c9cb59 Refactor Levenshtein distance implementation (#5138)
* ref: refactor Levenshtein distance implementation
- Rewrite the original levenshtein distance implementation in functional style
- Add optimized version of levenshtein distance

* ref: make `LevenshteinDistance` class a proper utility

* ref: remove duplicated test data

* ref: update tests

---

Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
2024-05-04 11:13:30 +02:00
b3903f5768 style: enable RedundantModifier in checkstyle (#5140) 2024-05-03 22:10:49 +03:00
1e2d7e9431 style: enable ConstantName in checkstyle (#5139)
Co-authored-by: Maria Paszkiewicz SCC <maria.paszkiewicz@kit.edu>
2024-05-02 18:31:37 +02:00
f64bc3c65d style: include UC_USELESS_OBJECT (#5127) 2024-05-01 11:11:03 +00:00
06a284f811 style: enable ModifierOrder in checkstyle (#5132)
* style: enable `ModifierOrder` in checkstyle

* style: remove redundant `final`

Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>

---------

Co-authored-by: Maria Paszkiewicz SCC <maria.paszkiewicz@kit.edu>
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
2024-05-01 13:06:19 +02:00
2513ccd62b style: include IM_AVERAGE_COMPUTATION_COULD_OVERFLOW (#5131) 2024-05-01 15:28:04 +05:30
de18d0df7e style: enable EmptyStatement (#5120) 2024-04-26 22:39:03 +03:00
6de154d218 tests: add tests of Mode (#5104) 2024-04-26 06:40:01 +00:00
8129686e2e Added tests for FactorialRecursion (#5109)
* Added tests for `FactorialRecursion`

* Apply suggestions from code review

Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>

---------

Co-authored-by: Maria Paszkiewicz SCC <maria.paszkiewicz@kit.edu>
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
2024-04-20 20:31:13 +02:00
7201dc78ad Added tests for NumberOfDigits (#5107)
Co-authored-by: Maria Paszkiewicz SCC <maria.paszkiewicz@kit.edu>
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
2024-04-13 20:45:07 +02:00
c53f178308 Implement Parentheses Generator (#5096)
* chore: add `ParenthesesGenerator` to `DIRECTORY.md`

* feat: implement Parentheses Generator

* ref: change `ParenthesesGenerator`s method to `static`

* ref: use parametrized tests

* ref: handling exception when `n < 0`

* chore: update docstrings

* ref: make `ParenthesesGenerator` to be a proper utility

* chore(docs): add private constructor docstring

* ref(tests): move bad name suggestions

* style: remove reduntant comments

---------

Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
2024-04-05 18:41:27 +02:00
22310defcd Cleaned up code for some packages (#5094)
* Cleaned up code of some packages

---------

Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
2024-04-02 21:26:06 +02:00
098f044370 Remove CalculateMaxOfMin (#5079) 2024-03-22 19:18:08 +08:00
192427a5d2 Parameterize references to generic types. (#5078)
* chore: remove unused imports

* fix: parameterize references to generic types


---------

Co-authored-by: vil02 <65706193+vil02@users.noreply.github.com>
2024-03-15 19:03:27 +01:00
ab371843ac Close Scanner to avoid resource leak (#5077) 2024-03-12 19:49:58 +01:00
47a9b1b647 Add WelshPowell (Graph Colouring) (#5034)
* Welsh Powell Algorithm + Test


---------

Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
2024-02-12 20:48:07 +01:00
14b3f45f9f Add ExchangeSort (#5029)
* added ExchangeSort and its testcases

---------

Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
2024-02-01 09:25:31 +01:00
55f08cc013 Add tests SumOfSubset (#5021)
* Updated main and test

* removed

* style: reorder test cases

---------

Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
2024-01-26 19:30:26 +01:00
a216cb8a59 Remove unused import from HashMapCuckooHashing (#5018)
style: remove unused import from `HashMapCuckooHashing`
2024-01-13 09:28:50 +00:00
3528399b2e Remove unused import from JobSequencing (#5017)
style: remove unused import from `JobSequencing`
2024-01-13 10:26:44 +01:00
fd84b0b10e Add SRTF Algorithm (#5011) 2024-01-08 23:48:11 +02:00
0c881e39f2 Simplify minimizing lateness (#4999) 2024-01-08 15:34:36 +02:00
8930ab5b16 Cleanup SumOfDigits and its tests (#4994) 2024-01-05 23:05:52 +02:00
1ea95ffa92 Cleanup PerfectSquare and its tests (#4992) 2024-01-04 12:56:48 +02:00
092ac5795b Remove SetKthBit in favor of SingleBitOperations.setBit (#4991) 2024-01-04 00:28:59 +02:00
6a0c0585e4 Add cross-correlation and auto-correlation (#4984) 2024-01-03 20:11:07 +02:00
9bef5a169c Add Playfair Cipher (#4988) 2024-01-03 15:14:38 +02:00
a7d140a43e Add Set Kth Bit (#4990) 2024-01-02 20:18:01 +02:00
7ece806cf5 Remove duplicate file of Simple Substitution Cipher (fixes #4494) (#4495) 2023-12-26 00:24:28 +02:00
e26fd9da71 Add OR-Set (Observed-Remove Set) (#4980) 2023-12-11 23:05:43 +02:00
4aa8e6a0eb Updated TwoPSet to use Generics instead of Strings (#4981) 2023-12-11 20:58:56 +02:00
b8b1dea38d Add LWW Element Set (Last Write Wins Element Set) (#4979) 2023-12-08 20:57:07 +02:00
92131de377 Fix compare() for subset check (S.A ⊆ T.A) (#4978) 2023-12-07 18:06:56 +02:00
249ee1dc99 Add 2P-Set (Two-Phase Set) for both addition and removal operations in distributed systems (#4977) 2023-12-07 17:23:22 +02:00
36580bac1e Fix typo in NextGraterElement (#4976) 2023-12-06 09:37:58 +02:00
e59a3b1ebb Add G-Set (Grow-only Set) (#4975) 2023-12-05 20:39:18 +02:00
3001620c1e Add PN-Counter (#4974) 2023-12-04 18:22:02 +02:00
e759544c33 Add Boruvka's algorithm to find Minimum Spanning Tree (#4964) 2023-12-02 19:53:17 +02:00
9bebcee5c7 Make sumOfDigits long in HarshadNumber.isHarshad (#4973)
fix: make `sumOfDigits` `long` in `HarshadNumber.isHarshad`
2023-11-30 22:06:31 +05:30
fc21a8bffe Explicitly cast result of Math.pow to long in Armstrong (#4972) 2023-11-30 10:50:09 +02:00
f8de290188 Explicitly cast result of Math.pow to int in BinaryToHexadecimal (#4970) 2023-11-29 23:30:59 +02:00
361b4108ee Use explicit cast to int in FractionalKnapsack (#4971) 2023-11-29 23:21:25 +02:00
1518e84fb9 Add Tribonacci Numbers (fixes #4646) (#4959) 2023-11-26 13:34:13 +02:00
b1efd4e34b Add G-Counter (Grow-only Counter) (#4965) 2023-11-24 19:13:44 +02:00
c527dff92d Add Javadoc comments (#4745) 2023-11-11 22:55:48 +02:00
574138c7a3 Cleanup BoyerMoore (#4951)
* 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>
2023-10-31 09:07:59 +01:00
d086afce09 Enhance code density and readability (#4914)
* Enhance code density and readability

* Add wiki link

---------

Co-authored-by: vil02 <65706193+vil02@users.noreply.github.com>
2023-10-30 23:18:05 +01:00