Commit Graph

83 Commits

Author SHA1 Message Date
JeevaRamanathan
7e29be3ad8 Added isogram utility class and unit tests (#6594)
* added isogram utility class and unit tests

Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>

* checking lint issue

Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>

* checking lint issue

Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>

* checking lint issue

Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>

* checking lint issue

Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>

* checking lint issue

Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>

* checking lint issue

Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>

* checking lint issue

Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>

* checking lint issue

Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>

* linter fix

Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>

* fix: HideUtilityClassConstructor

Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>

* linter fix

Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>

* updated isogram class to final

Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>

* pipeline bug fixing

Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>

* renamed function names and few fixes w.r.t to suggestion

Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>

---------

Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>
2025-10-03 14:33:12 +03:00
Milad Sadeghi
ef681e844d DEV: Implementing Alternative String Arrange (#6551) 2025-09-29 13:13:50 +03:00
Nithin U
85a2df46ad To add Suffix array algorithm implementation (#6530)
* adding Suffix Array Implementation

* adding test for Suffix Array

* patch: lint fix in SuffixArray.java

* patch: lint fix in SuffixArrayTest.java

* fix: private constructor update

* patch: lint fix in suffix array impl

* fix: lint issue line blankspace removal

* fix: checkstype issue

* fix: lint format issue

* Update DIRECTORY.md
2025-09-17 17:56:10 +02:00
Nihar Kakani
27ada8a649 Migrate recursive reverse string method and tests to ReverseString (#6504)
* Migrate recursive reverse string method and tests to ReverseString

- Moved recursive reverse method from ReverseStringRecursive.java to ReverseString.java
- Moved tests from ReverseStringRecursiveTest.java to ReverseStringTest.java
- Deleted old ReverseStringRecursive files

* Fix formatting for ReverseStringTest.java as per clang-format linter
2025-08-27 16:59:04 +02:00
Deniz Altunkapan
6c24d27b03 Move methods from others to correct packages (#6475)
refactor: Move methods from `others` package to their respective packages
2025-08-18 22:28:19 +02:00
Navaneedan S
e09c98578f Add ReverseStringUsingStack (#6452)
* Refactored ReverseStringUsingStack
* Add ReverseStringUsingStack
* Refactored ReverseStringUsingStack
* Closes #6451
2025-08-01 21:16:10 +02:00
Oleksandr Klymenko
048bba9499 refactor: adding docs for LongestCommonPrefixTest and Parameterized Tests (#6360)
* refactor: adding docs for LongestCommonPrefixTest and Parameterized Tests

* checkstyle: fix clang formatting

---------

Co-authored-by: Deniz Altunkapan <93663085+DenizAltunkapan@users.noreply.github.com>
2025-07-11 19:39:33 +00:00
Oleksandr Klymenko
3e0fd11a96 refactor: refactoring and documenting Isomorphic String Checker (#6359)
refactor: refactoring and documenting Isomorphic String Checker

Co-authored-by: Deniz Altunkapan <93663085+DenizAltunkapan@users.noreply.github.com>
2025-07-11 19:36:29 +00:00
Oleksandr Klymenko
f3252793e1 refactor: refactor Alphabetical and AlphabeticalTest (#6355) 2025-07-10 17:52:38 +02:00
Oleksandr Klymenko
6c3049530f refactor: optimize ValidParentheses methods and add parameterized tests (#6352) 2025-07-08 10:50:06 +03:00
Deniz Altunkapan
1745d19f09 refactor: unified duplicate Anagram classes into a single implementation (#6290) 2025-06-11 20:04:06 +03:00
geetoormvn
849ab913c0 Add reverseUsingStringBuilder method to reverse a string (#6182) 2025-02-27 10:45:52 +00:00
p@ren
bd785dea4d Refactor and enhance the 'Upper' class (#6118) 2025-01-12 11:29:27 +00:00
Rully
08c0f4ac2d improve zig-zag-pattern (#6128) 2025-01-12 13:13:01 +02:00
Ramit Gangwar (NoiR)
3da16a7fe0 Add LongestCommonPrefix (#5849) 2024-10-26 19:01:47 +00:00
Piotr Idzik
8886e0996a style: include OCP_OVERLY_CONCRETE_PARAMETER (#5833) 2024-10-14 23:46:28 +03:00
Taranjeet Singh Kalsi
4a5bf39f8e Add another method to check valid parentheses in ValidParentheses.java (#5616) 2024-10-07 21:48:02 +03:00
B Karthik
042d458d34 fix: change location of others to correct places (#5559) 2024-10-04 17:47:50 +00:00
donutz03
1460eb7bbe Add Manacher’s Algorithm for Longest Palindromic Substring (#5462)
* Added Manacher Algorithm

* Formatted ManacherTest.java

* Formatted Manacher.java

* Refactor: Update Manacher's algorithm tests and improve readability

- Added parameterized tests for longestPalindrome, empty cases, complex cases, and sentence palindromes.
- Removed unnecessary comments for cleaner code.
- Renamed variable `p` to `palindromeLengths` for clarity based on code review feedback.

---------

Co-authored-by: Ionut Hodoroaga <ionut.hodoroaga20@gmail.com>
2024-09-24 16:21:57 +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
14916e692f refactor: WordLadder (#5434)
* refactor: WordLadder

* refactor: fix redundant check

---------

Co-authored-by: alxkm <alx@alx.com>
2024-08-30 09:49:55 +02:00
Alex Klymenko
87cf89192b style: use proper spelling (#5436)
checkstyle: fix typos, style

Co-authored-by: alxkm <alx@alx.com>
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
2024-08-30 08:50:14 +02:00
Alex Klymenko
b2815db5cd refactor: LongestNonRepetitiveSubstring (#5421)
* refactor: LongestNonRepetitiveSubstring

* checkstyle: fix formatting

---------

Co-authored-by: alxkm <alx@alx.com>
2024-08-28 18:40:27 +02:00
Alex Klymenko
49d1c84cb7 refactor: ReverseString, test improvements (#5406)
* refactor: ReverseString

* refactor: refactor testing into two methods

* checkstyle: fix formatting

* checkstyle: fix formatting

---------

Co-authored-by: alxkm <alx@alx.com>
2024-08-27 13:00:11 +02:00
Alex Klymenko
e3ad3761fd refactor: StringCompression (#5410)
refactor: StringCompression

Co-authored-by: alxkm <alx@alx.com>
2024-08-27 12:02:50 +02:00
Alex Klymenko
0c8616e332 test: ReverseStringRecursiveTest (#5407)
* test: ReverseStringRecursiveTest

* checkstyle: fix formatting

* checkstyle: fix formatting

---------

Co-authored-by: alxkm <alx@alx.com>
2024-08-27 10:49:20 +02:00
Alex Klymenko
c5b73ec742 refactor: HammingDistance (#5404)
* refactor: HammingDistance

* checkstyle: fix formatting

---------

Co-authored-by: alxkm <alx@alx.com>
2024-08-26 16:37:17 +02:00
Alex Klymenko
d810a1d4da test: LongestPalindromicSubstring (#5402)
* LongestPalindromicSubstring

* fix Rule:CollapsibleIfStatements

---------

Co-authored-by: alxkm <alx@alx.com>
2024-08-26 16:29:16 +02:00
Alex Klymenko
5f6510f0fa refactor: CharactersSame (#5396) 2024-08-26 09:55:50 +03:00
Alex Klymenko
93e417544d refactor: Anagrams (#5390) 2024-08-26 08:26:01 +03:00
Alex Klymenko
580aa0c9c5 refactor: CheckVowels (#5393) 2024-08-25 23:14:33 +03:00
Alex Klymenko
a7cd97d75e refactor: fix typo (#5372) 2024-08-24 11:57:54 +03:00
Alex Klymenko
d7b60be7d1 refactor: PermuteString (#5362) 2024-08-23 12:33:41 +03:00
Alex Klymenko
fb55552ebb refactor: fix typo (#5363) 2024-08-23 10:58:08 +03:00
Alex Klymenko
74b05ef7c2 refactor: fix typo in class name LongestNonRepetitiveSubstring (#5359) 2024-08-22 12:37:52 +03:00
Alex Klymenko
622a3bf795 refactor: cleanup AhoCorasick (#5358) 2024-08-22 11:08:17 +03:00
Alex Klymenko
046f5a4728 refactor: atoi (#5324) 2024-08-15 11:43:47 +03:00
congyuluo
cafea1ee52 Refactored Identifiers (#5306)
Co-authored-by: Bama Charan Chhandogi <b.c.chhandogi@gmail.com>
2024-08-08 19:39:00 +05:30
Samuel Facchinello
74e51990c1 style: enable InvalidJavadocPosition in checkstyle (#5237)
enable style InvalidJavadocPosition

Co-authored-by: Samuel Facchinello <samuel.facchinello@piksel.com>
2024-06-18 19:34:22 +02:00
Samuel Facchinello
87b17e0571 style: enable NeedBraces in checkstyle (#5227)
* enable style NeedBraces

* style: enable NeedBraces in checkstyle

---------

Co-authored-by: Samuel Facchinello <samuel.facchinello@piksel.com>
2024-06-13 21:00:16 +02:00
Samuel Facchinello
51fcc66345 refactor: redesign LetterCombinationsOfPhoneNumber (#5221)
* Refactor

* fix clang

* fix clang

* fix clang tests

* fix pattern

* add test case null

* Update src/main/java/com/thealgorithms/strings/LetterCombinationsOfPhoneNumber.java

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

* Update src/main/java/com/thealgorithms/strings/LetterCombinationsOfPhoneNumber.java

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

* Update src/main/java/com/thealgorithms/strings/LetterCombinationsOfPhoneNumber.java

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

* Update src/main/java/com/thealgorithms/strings/LetterCombinationsOfPhoneNumber.java

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

* Update src/main/java/com/thealgorithms/strings/LetterCombinationsOfPhoneNumber.java

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

* Update src/main/java/com/thealgorithms/strings/LetterCombinationsOfPhoneNumber.java

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

* Update src/test/java/com/thealgorithms/strings/LetterCombinationsOfPhoneNumberTest.java

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

* rename MAP_OF_CHARS to KEYPAD

* fix clang

* remove main

* add tests

* feat: throw for wrong inputs

* change keypad to list

* Update src/main/java/com/thealgorithms/strings/LetterCombinationsOfPhoneNumber.java

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

* Update src/main/java/com/thealgorithms/strings/LetterCombinationsOfPhoneNumber.java

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

* Update src/main/java/com/thealgorithms/strings/LetterCombinationsOfPhoneNumber.java

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

* fix with number 1 (empty value), and add tests

* style: avoid concatenation while populating `KEYPAD`

* change to assertEquals

---------

Co-authored-by: Samuel Facchinello <samuel.facchinello@piksel.com>
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
2024-06-13 19:40:12 +02: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
S. Utkarsh
25d711c5d8 style: enable LocalVariableName in CheckStyle (#5191)
* style: enable LocalVariableName in checkstyle

* Removed minor bug

* Resolved Method Name Bug

* Changed names according to suggestions
2024-05-28 20:29:28 +02:00
Bama Charan Chhandogi
37c2a96fe2 style: enable MissingSwitchDefault in checkstyle (#5179)
* Update directory

* Update directory

* Update directory

* Update directory

* add switch default

---------

Co-authored-by: BamaCharanChhandogi <BamaCharanChhandogi@users.noreply.github.com>
2024-05-26 17:28:00 +05:30
vaibhav9t1
9eaa2bb756 style: enable MultipleVariableDeclarations in checkstyle (#5175)
Co-authored-by: vaibhav <vaibhav.waghmare@techprescient.com>
2024-05-25 20:18:27 +02:00
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
Kanivets Kateryna
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
SOZEL
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
Prabhat-Kumar
8200a791a2 Add AhoCorasick (#4465)
* Added code to find Articulation Points and Bridges

* tried to solve clang-formant test

* removed new line at EOF to get lint to pass

* feature: Added Ahocorasick Algorithm

* fixed lint using clang-format

* removed datastructures/graphs/ArticulationPointsAndBridge.java from this branch

* removed main, since test-file is added. Also modified and renamed few functions.

* Added test-file for AhoCorasick Algorithm

* Modified some comments in test-file

* Modified some comments in AhoCorasick.java

* lint fix

* added few more test cases

* Modified some comments

* Change all class fields to private, added initializeSuffixLinksForChildNodesOfTheRoot() method, hashmap string search position (also has previous index based search), removed java.util.*

* Added Missing Test-Cases and more

* minor text changes

* added direct test check i.e. defining a variable expected and just checking if res and expected are equal.

* Created New Class Trie, merged 'buildTrie and buildSuffixAndOutputLinks' with 'Trie constructor'. Merged setUpStartPoints with searchIn. Now AhoCorasick contains -> inner class: Trie, Node. Methods: search and convert. Trie has -> Methods : constructor and searchIn

* Updated TestFile according to the updated AhoCorasick Class. Added Few more test cases

* updated - broken down constructor to relavent parts, made string final, made res local to searchIn(), doxygen-like style

* lint fix clang

* Updated Tests Files

* Added final field to Node class setters and Trie Constructor arguments, removed getTrieRoot() and some unnecessory comments, renamed [old -> new]: res -> positionByStringIndexValue, removed if condition from setupStartPoints()

* updated test file

* lint fix clang

* minor chage - 'removed a comment'

* added final fields to some arguments, class and variables, added a method initializePositionByStringIndexValue()

* updated to remove * inclusion and added the required modules only

* Implemented a new class PatternPositionRecorder to wrap up the position recording in searchIn()

* Added final fields to PatternPositionRecorder Class

* style: mark default constructor of `AhoCorasick` as `private`

* style: remoce redundant `public`

---------

Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
2023-10-08 15:16:06 +02:00