Commit Graph

75 Commits

Author SHA1 Message Date
Oleksandr Klymenko
ef93cc1503 refactor: TwoPointers (#6374)
* refactor: TwoPointers

* refactor: fix test formatting

* refactor: fix checkstyle

* refactor: fix checkstyle
2025-07-13 09:25:26 +00:00
Hakim's Garage
e6073f8fef Add math builder (#6190) 2025-03-12 18:35:21 +02:00
varada610
4ef06822ca Create package prime, matrix and games (#6139) 2025-01-27 11:10:41 +00:00
varada610
1e6ed97fcf Refactor files to be in correctly nested packages (#6120) 2025-01-11 09:17:40 +02:00
Strange Developer
df0c997e4b General performance improvement (#6078) 2024-11-01 19:52:42 +02:00
pranayh24
985c1f9dd1 Add Maximum Sliding Window algorithm (#5848) 2024-10-26 19:05:14 +00:00
Hardik Pawar
596c6147af Add function documentation, enhance comments in TowerOfHanoi.java (#5533) 2024-10-13 12:30:53 +03:00
Giulio Tantaro
2a167f4bc3 Add tests Sudoku (#5722)
* Add tests Sudoku

* Fix

* Update file

---------

Co-authored-by: Giulio Tantaro <giulio.tantaro@codeploy.it>
Co-authored-by: Alex Klymenko <alexanderklmn@gmail.com>
2024-10-11 22:21:13 +03:00
Hardik Pawar
2592a088e7 Enhance readability, add comments & function docs to SkylineProblem.java (#5534) 2024-10-07 15:26:21 +03:00
B Karthik
042d458d34 fix: change location of others to correct places (#5559) 2024-10-04 17:47:50 +00:00
Alex Klymenko
bded78f888 refactor: BFPRT (#5445)
refactor: adding javadocs and tests for BFPRT
2024-09-09 10:07:30 +03:00
Alex Klymenko
b0de93b3ce refactor: change packages (#5430)
* refactor: change package

* refactor: fix name

---------

Co-authored-by: alxkm <alx@alx.com>
2024-08-30 11:58:24 +02:00
Alex Klymenko
c5b72816f3 refactor: MaximumSumOfDistinctSubarraysWithLengthK (#5433)
* refactor: MaximumSumOfDistinctSubarraysWithLengthK

* checkstyle: fix formatting

* checkstyle: fix formatting

* checkstyle: fix formatting

---------

Co-authored-by: alxkm <alx@alx.com>
2024-08-30 10:03:43 +02:00
Alex Klymenko
e2aaefebd5 refactor: CountWords (#5428)
* refactor: CountWords

* checkstyle: fix formatting

---------

Co-authored-by: alxkm <alx@alx.com>
2024-08-28 22:34:46 +02:00
Alex Klymenko
6b7a1fdbe8 refactor: QueueUsingTwoStacks (#5427)
refactor: QueueUsingTwoStacks

Co-authored-by: alxkm <alx@alx.com>
2024-08-28 22:25:46 +02:00
Alex Klymenko
0733075498 test: CountCharTest (#5423)
test: CountCharTest

Co-authored-by: alxkm <alx@alx.com>
2024-08-28 18:45:23 +02:00
Alex Klymenko
fc5a70edc9 refactor: ReturnSubsequence (#5408)
* refactor: ReturnSubsequence

* checkstyle: fix formatting

* checkstyle: fix formatting

---------

Co-authored-by: alxkm <alx@alx.com>
2024-08-27 13:12:49 +02:00
Alex Klymenko
35f23d2ddc refactor: BoyerMoore (#5395) 2024-08-26 10:33:24 +03:00
Alex Klymenko
cdb6412601 refactor: LineSweep (#5398) 2024-08-26 09:45:07 +03:00
Alex Klymenko
a5f57fbfde refactor: ArrayLeftRotationTest (#5389) 2024-08-25 23:08:10 +03:00
Alex Klymenko
25b8010ea8 refactor: cleanup EulersFunction (#5388) 2024-08-25 22:44:55 +03:00
Alex Klymenko
f3851e3adc refactor: RemoveDuplicateFromString (#5387) 2024-08-25 22:33:41 +03:00
Alex Klymenko
69e1fe9cfb refactor: LowestBasePalindrome (#5385) 2024-08-25 10:16:14 +03:00
Alex Klymenko
0b0b26e3fe refactor: ReverseStackUsingRecursion (#5386) 2024-08-25 10:12:17 +03:00
Alex Klymenko
38688440ef refactor: TwoPointers (#5380) 2024-08-25 09:29:17 +03:00
Alex Klymenko
75355e87b6 refactor: PasswordGen (#5373) 2024-08-24 11:57:40 +03:00
Alex Klymenko
ce4eb55e0e refactor: FloydTriangle (#5367) 2024-08-23 15:55:13 +03:00
Samuel Facchinello
9973b8efc8 refactor: redesign StringMatchFiniteAutomata (#5222)
* refactor

* add test

* fix clang

* fix pmd

* remove main method

* refactor searchPattern with private class

* fix checkstyle

* Update src/main/java/com/thealgorithms/others/StringMatchFiniteAutomata.java

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

* Update src/main/java/com/thealgorithms/others/StringMatchFiniteAutomata.java

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

* Update src/main/java/com/thealgorithms/others/StringMatchFiniteAutomata.java

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

* fix clang

* tests: add more test cases

---------

Co-authored-by: Samuel Facchinello <samuel.facchinello@piksel.com>
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
2024-06-17 20:55:20 +00:00
StarDxxx
a81fb32e6c style: enable TypeName (#5214)
* style: enable `TypeName` in checkstyle

* style: enable `TypeName` in checkstyle

* Update directory

* style: use proper formatting

---------

Co-authored-by: StarDxxx <StarDxxx@users.noreply.github.com>
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
2024-06-08 13:37:20 +02:00
Godwill Christopher
295e7436b1 style: enable MethodName in CheckStyle (#5182)
enabled: MethodName in CheckStyle
2024-05-27 09:06:06 +02:00
Piotr Idzik
d2ddec55e5 style: include NAB_NEEDLESS_BOOLEAN_CONSTANT_CONVERSION (#5149)
* style: use `assertFalse` and `assertTrue`

* style: include `NAB_NEEDLESS_BOOLEAN_CONSTANT_CONVERSION`
2024-05-08 22:41:46 +05:30
Piotr Idzik
d3bb691f59 style: enable HideUtilityClassConstructor in checkstyle (#5147) 2024-05-08 09:58:29 +03:00
Piotr Idzik
414835db11 style: enable AvoidStarImport in checkstyle (#5141) 2024-05-05 20:48:56 +02:00
Sarthak Chaudhary
8804cec957 Feature/4638 array right rotation (#5014)
* Create ArrayRightRotationTest.java

* Create ArrayRightRotation.java

* The updated one

* The updated one

* Added the test cases

* Added new test cases!

* Update ArrayRightRotation.java

* Update ArrayRightRotationTest.java
2024-01-13 13:59:30 +05:30
Piotr Idzik
19b7a22ec9 Remove unused imports from BoyerMooreTest (#5012) 2024-01-10 20:31:38 +02:00
Prathamesh Powar
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
Satvik Singh Sengar
945e7b56bb Fix:/Number of count of major element in Boyer Moore algorithm (#4728)
* Number of count of major element in Boyer Moore algorithm

* test: add `BoyerMooreTest`

* style: basic linting

* tests: add test case from the issue

---------

Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
Co-authored-by: vil02 <vil02@o2.pl>
2023-10-30 18:24:23 +01:00
Subhradeep Bera
26c2465328 Moved StackPostfixNotation.java from the Others section to the Stack section (#4372)
* Moved StackPostfixNotation.java from the Others section to the Stack section

* Put all stack related algo in a separate stack directory in the algorithms directory. The stack directory under data-structures now only contains various implementations of the stack data structure.

* formatted files
2023-09-18 21:27:36 +02:00
Manan Solanki
5bb54977fe #4369 Enhance UniquePaths (#4373)
* Enhance UnquiePaths DP problem solution

* Update testcases

* Linter issue resolved

* Code review comments

* Code review comments

* Code review comments

* Code review comments

---------

Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
2023-09-14 19:45:16 +02:00
Piotr Idzik
f010a47608 chore: enforce InsertNewlineAtEOF in clang-format (#4343)
* style: insert newline at eof

* style: use `InsertNewlineAtEOF` in `clang-format`

* fix: use `clang-format-16`

* chore: update clang-format-lint-action to v0.16.2

---------

Co-authored-by: Debasish Biswas <debasishbsws.dev@gmail.com>
2023-09-01 04:10:46 +00:00
SwargaRajDutta
af80c8005d Add Sliding Window Problem (#4322) 2023-08-18 14:08:40 +00:00
Piotr Idzik
e5c7a08874 Handle inputs like "2 +" in StackPostfixNotation (#4262) 2023-07-26 14:11:28 +03:00
Piotr Idzik
44dcebb699 Handle incorrect inputs in StackPostfixNotation (#4261) 2023-07-26 06:20:56 +00:00
HManiac74
2488a2ad51 Code cleanup (#4246) 2023-07-22 15:23:00 +00:00
Piotr Idzik
63739f4933 refactor: simplify HammingDistance (#4218)
* refactor: make HammingDistance an utility class

* tests: add some tests, simplify logic of some

* refator: simplify logic in HammingDistance

* style: remove logging messages
2023-06-21 21:11:13 +05:30
Piotr Idzik
7a3273ae1d tests: add tests for SieveOfEratosthenes (#4217)
* tests: add tests for SieveOfEratosthenes

* feat: throw for inputs <= 0

* refactor: simplify logic in SieveOfEratosthenes.findPrimesTill

* refactor: make SieveOfEratosthenes a utility class

* docs: update docs, fix typo
2023-06-20 23:58:53 +05:30
Piotr Idzik
87d6083bac Add tests for EulersFunction (#4216) 2023-06-19 20:46:54 +03:00
acbin
415a04ea7f Add automatic linter (#4214) 2023-06-09 20:05:14 +08:00
acbin
00282efd8b style: format code (#4212)
close #4204
2023-06-09 18:52:05 +08:00
Piotr Idzik
ad03086f54 Remove main and add tests for CountWords (#4210) 2023-06-02 16:28:33 +00:00