Skip to content
Open
Changes from 1 commit
Commits
Show all changes
1132 commits
Select commit Hold shift + click to select a range
4b6006c
refactor: improve code and test coverage for `MapReduce` example (#6348)
alxkm Jul 6, 2025
8512f12
Fix the formatting issue with clang-format (#6346)
pushkar0406 Jul 7, 2025
2f5bc8c
refactor: improve median calculator class design and readability (#6349)
alxkm Jul 7, 2025
fa2ca9d
refactor: improve PythagoreanTriple logic and add parameterized tests…
alxkm Jul 7, 2025
6c30495
refactor: optimize ValidParentheses methods and add parameterized tes…
alxkm Jul 8, 2025
4768987
Update CODEOWNERS (#6353)
siriak Jul 8, 2025
c997a32
refactor ShuffleArray: improve documentation and maintainability (#6357)
alxkm Jul 9, 2025
a6aadd5
refactor: improve Sparsity class with input validation and clearer lo…
alxkm Jul 9, 2025
22cba2c
chore(deps): bump org.apache.commons:commons-lang3 from 3.17.0 to 3.1…
dependabot[bot] Jul 10, 2025
f325279
refactor: refactor Alphabetical and AlphabeticalTest (#6355)
alxkm Jul 10, 2025
2ccc156
refactor: clean up LargestRectangle and convert tests to parameterize…
alxkm Jul 11, 2025
3e0fd11
refactor: refactoring and documenting `Isomorphic String Checker` (#6…
alxkm Jul 11, 2025
048bba9
refactor: adding docs for `LongestCommonPrefixTest` and Parameterized…
alxkm Jul 11, 2025
0a4f554
cleanup: Improve docs, safety, and readability in `RangeInSortedArray…
alxkm Jul 11, 2025
acb4753
refactor: Improve readability and code clarity in `InfixToPostfix` (#…
alxkm Jul 12, 2025
7590d82
refactor: add JavaDocs and improve readability in `InfixToPrefix` (#6…
alxkm Jul 12, 2025
dba2d86
refactor: improving `GenericRoot` (#6365)
alxkm Jul 12, 2025
910d5b8
refactor: Refactor `SJFScheduling` and Tests (#6372)
alxkm Jul 13, 2025
182118b
refactor: cleanup `GenerateSubsets` (#6373)
alxkm Jul 13, 2025
ef93cc1
refactor: `TwoPointers` (#6374)
alxkm Jul 13, 2025
933e929
refactor: refactor `Ceil` and improved tests (#6366)
alxkm Jul 14, 2025
25aaa6e
refactor: `OnesComplement` Tests Using Parameterized Inputs (#6375)
alxkm Jul 14, 2025
95116db
refactor: improving `MedianOfMatrix` (#6376)
alxkm Jul 15, 2025
7e37d94
refactor: improving readability `DecimalToAnyUsingStack` (#6377)
alxkm Jul 15, 2025
ca7c77f
refactor: improving `DisjointSetUnion` (#6378)
alxkm Jul 15, 2025
287a708
refactor: `Intersection` (#6379)
alxkm Jul 15, 2025
dcb02c6
refactor: `MajorityElement` (#6380)
alxkm Jul 15, 2025
d55e89d
refactor: `Mode` (#6381)
alxkm Jul 16, 2025
434ab50
refactor: `Convolution` (#6382)
alxkm Jul 16, 2025
dd1a51b
testing: add more cases for `AverageTest` (#6384)
alxkm Jul 16, 2025
440b6f5
testing: improve tests coverage `AbsoluteValueTest` (#6385)
alxkm Jul 17, 2025
a796f6d
testing: added unit tests for the `BinaryPow.binPow` (#6386)
alxkm Jul 17, 2025
054002a
testing: added unit tests for the `MinStackUsingTwoStacks` (#6387)
alxkm Jul 17, 2025
7f6e677
testing: improve test coverage `SortedLinkedListTest` (#6388)
alxkm Jul 17, 2025
2f2a32b
testing: improve test coverage `ParityCheckTest` (#6389)
alxkm Jul 17, 2025
d0d4b3c
testing: additional testcases for `CountSinglyLinkedListRecursionTest…
alxkm Jul 18, 2025
44c572b
chore(deps): bump com.mebigfatguy.fb-contrib:fb-contrib from 7.6.11 t…
dependabot[bot] Jul 18, 2025
fc477ee
testing: improving test coverage `CountingInversionsTest` (#6393)
alxkm Jul 18, 2025
d6a871e
testing: improve test coverage `RangeInSortedArrayTest` (#6395)
alxkm Jul 18, 2025
5c6d3c3
Update DIRECTORY.md (#6414)
DenizAltunkapan Jul 18, 2025
76aea42
testing: improving test coverage `DisjointSetUnionTest` (#6394)
alxkm Jul 19, 2025
d14e8a6
testing: improve test coverage `DuplicateBracketsTest` (#6396)
alxkm Jul 19, 2025
334543f
testing: improve test coverage `PriorityQueuesTest` (#6397)
alxkm Jul 19, 2025
0a46b82
testing: Enhance `ValidParenthesesTest` (#6398)
alxkm Jul 19, 2025
c7af421
test: PointTest.java #HSFDPMUW (#6391)
justakayy Jul 20, 2025
171fdc9
testing: improving `CRCAlgorithmTest` (#6403)
alxkm Jul 20, 2025
b45fd2a
Update DIRECTORY.md (#6419)
DenizAltunkapan Jul 20, 2025
31bf130
refactor: improving `Median` (#6404)
alxkm Jul 20, 2025
0e9be57
testing: improving `PostfixEvaluatorTest` (#6405)
alxkm Jul 21, 2025
75298bb
testing: improving `DequeTest` (#6410)
alxkm Jul 21, 2025
2722b0e
testing: improving `SkipListTest` (#6411)
alxkm Jul 21, 2025
2dfad7e
Add matrix multiplication with double[][] and unit tests (#6417)
Nishitha0730 Jul 21, 2025
c9cc8f4
Add cache with LIFO replacement policy (#6390)
KevinMwita7 Jul 21, 2025
9a46339
Update DIRECTORY.md (#6426)
DenizAltunkapan Jul 21, 2025
78b6219
testing: improving `GenerateSubsetsTest` (#6412)
alxkm Jul 22, 2025
bbbc1dd
testing: improving CountSinglyLinkedListRecursionTest (#6413)
alxkm Jul 22, 2025
cfd7841
Feat(Improved): Add 0/1 Knapsack Problem: Recursive and Tabulation (B…
o000SAI000o Jul 22, 2025
ceead5e
testing: refactor to ParameterizedTest `PrefixEvaluatorTest` (#6415)
alxkm Jul 22, 2025
7c2af29
Update DIRECTORY.md (#6431)
DenizAltunkapan Jul 22, 2025
3304cf2
testing: improve `QueueByTwoStacksTest` (#6416)
alxkm Jul 22, 2025
bcfb3f2
chore(deps): bump org.junit:junit-bom from 5.13.3 to 5.13.4 (#6434)
dependabot[bot] Jul 22, 2025
073b6f1
testing: improve `CircularBufferTest` (#6418)
alxkm Jul 23, 2025
7e3fbae
testing: improve `SortStackTest` (#6422)
alxkm Jul 23, 2025
6992716
testing: improve `QueueTest` (#6423)
alxkm Jul 23, 2025
ec7b654
testing: improve `StackArrayTest` (#6424)
alxkm Jul 24, 2025
ac58493
testing: improve test coverage `CursorLinkedListTest` (#6428)
alxkm Jul 24, 2025
4f16ad0
testing: improve test coverage `DequeTest` (#6429)
alxkm Jul 24, 2025
fc07cd8
testing: improve test coverage `StackOfLinkedListTest` (#6430)
alxkm Jul 24, 2025
edb8167
testing: improve test coverage `NodeStackTest` (#6432)
alxkm Jul 25, 2025
040d385
testing: improve `BagTest` (#6435)
alxkm Jul 25, 2025
032f75c
testing: improve `DisjointSetUnionTest` (#6440)
alxkm Jul 25, 2025
2eb80fb
Remove duplicate SimpleSort (same logic as ExchangeSort) (#6441)
lucasgm18 Jul 26, 2025
a8b579e
#6336/enhancement/Refactor: Standardize comparison logic using SortUt…
dinishajais Jul 26, 2025
2b18008
Update DIRECTORY.md (#6446)
DenizAltunkapan Jul 26, 2025
066a109
testing: improve `BloomFilterTest` (#6443)
alxkm Jul 26, 2025
0081d5c
testing: improve testing `CRCAlgorithmTest` (#6444)
alxkm Jul 27, 2025
24f4090
testing: improve `MergeKSortedLinkedListTes` (#6445)
alxkm Jul 27, 2025
e09c985
Add ReverseStringUsingStack (#6452)
navaneedan07 Aug 1, 2025
1652d80
chore(deps-dev): bump org.assertj:assertj-core from 3.27.3 to 3.27.4 …
dependabot[bot] Aug 7, 2025
4d28c88
chore(deps): bump com.puppycrawl.tools:checkstyle from 10.26.1 to 11.…
dependabot[bot] Aug 8, 2025
57c6b03
chore(deps): bump actions/checkout from 4 to 5 in /.github/workflows …
dependabot[bot] Aug 12, 2025
657f433
Hopcroft karp Algorithm implementation and tests (#6465)
ptzecher Aug 14, 2025
16345cb
Update DIRECTORY.md (#6468)
DenizAltunkapan Aug 14, 2025
2dd6a13
Add DFS with parent-completion constraint for DAG traversal (#6467)
StathisVeinoglou Aug 15, 2025
b0d7c06
Update DIRECTORY.md (#6469)
DenizAltunkapan Aug 15, 2025
9f0dd37
chore(deps-dev): bump org.mockito:mockito-core from 5.18.0 to 5.19.0 …
dependabot[bot] Aug 15, 2025
6c24d27
Move methods from others to correct packages (#6475)
DenizAltunkapan Aug 18, 2025
0ff2c06
chore(deps): bump com.mebigfatguy.fb-contrib:fb-contrib from 7.6.12 t…
dependabot[bot] Aug 19, 2025
3f195c2
Update DIRECTORY.md (#6476)
DenizAltunkapan Aug 21, 2025
3961b1d
fix: revert ReverseStack deletion and verify linting (#6474) (#6494)
VickySource Aug 22, 2025
c046075
chore(deps): bump actions/setup-java from 4 to 5 in /.github/workflow…
dependabot[bot] Aug 22, 2025
e78d53d
chore(deps): bump com.github.spotbugs:spotbugs-maven-plugin from 4.9.…
dependabot[bot] Aug 25, 2025
27ada8a
Migrate recursive reverse string method and tests to ReverseString (#…
ai-nihar Aug 27, 2025
79dc0b4
chore: remove @vil02 from `CODEOWNERS` (#6512)
vil02 Aug 30, 2025
fe02c48
chore(deps): bump com.github.spotbugs:spotbugs-maven-plugin from 4.9.…
dependabot[bot] Sep 3, 2025
d09180e
chore(deps): bump com.mebigfatguy.fb-contrib:fb-contrib from 7.6.13 t…
dependabot[bot] Sep 3, 2025
1393f5e
Added-> DisjointUnion Set by Size (#6514)
TIWARIPRIYANSH Sep 3, 2025
676d36e
Update DIRECTORY.md (#6500)
DenizAltunkapan Sep 4, 2025
5e5f318
chore(deps): bump actions/stale from 9 to 10 in /.github/workflows (#…
dependabot[bot] Sep 5, 2025
f0437fe
chore(deps): bump actions/setup-python from 5 to 6 in /.github/workfl…
dependabot[bot] Sep 5, 2025
6c8de56
chore(deps): bump gitpod/workspace-java-21 from 2025-06-18-16-47-14 t…
dependabot[bot] Sep 9, 2025
f12e734
chore(deps): bump com.github.spotbugs:spotbugs-maven-plugin from 4.9.…
dependabot[bot] Sep 9, 2025
1472e51
chore(deps): bump org.apache.maven.plugins:maven-surefire-plugin from…
dependabot[bot] Sep 15, 2025
c370101
chore(deps): bump com.github.spotbugs:spotbugs-maven-plugin from 4.9.…
dependabot[bot] Sep 15, 2025
85a2df4
To add Suffix array algorithm implementation (#6530)
NithinU2802 Sep 17, 2025
45275ee
chore(deps): bump com.github.spotbugs:spotbugs-maven-plugin from 4.9.…
dependabot[bot] Sep 18, 2025
5fee204
Added PriorityQueueSort algorithm and Tests (#6532)
Rahul-150705 Sep 18, 2025
f57ffa9
chore(deps-dev): bump org.assertj:assertj-core from 3.27.4 to 3.27.5 …
dependabot[bot] Sep 19, 2025
0e74f01
chore(deps-dev): bump org.assertj:assertj-core from 3.27.5 to 3.27.6 …
dependabot[bot] Sep 22, 2025
eb4304e
chore(deps): bump org.apache.maven.plugins:maven-compiler-plugin from…
dependabot[bot] Sep 22, 2025
ce314e1
chore(deps-dev): bump org.mockito:mockito-core from 5.19.0 to 5.20.0 …
dependabot[bot] Sep 23, 2025
d29a8e5
Update DIRECTORY.md (#6533)
DenizAltunkapan Sep 23, 2025
09cacae
chore(deps): bump org.apache.commons:commons-lang3 from 3.18.0 to 3.1…
dependabot[bot] Sep 25, 2025
fb12971
Added BitwiseGCD.java and BitwiseGCDTest.java (#6545)
HetuKariya Sep 27, 2025
ef681e8
DEV: Implementing Alternative String Arrange (#6551)
miladsade96 Sep 29, 2025
881dafb
chore(deps): bump com.puppycrawl.tools:checkstyle from 11.0.0 to 11.1…
dependabot[bot] Sep 30, 2025
f9a9ccb
chore(deps): bump org.junit:junit-bom from 5.13.4 to 6.0.0 (#6558)
dependabot[bot] Sep 30, 2025
421ac6d
style: include `RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE` (#6559)
vil02 Oct 1, 2025
5e9d9f7
Added Circular Doubly Linked List in the datastructures section (#6565)
richk21 Oct 1, 2025
05ceb19
Bit swap enhancement (#6577)
kunwarbhattal Oct 1, 2025
f8f315e
Extend Graph Algorithms: Added Two Popular Algorithms: BronKerbosch, …
Sivasuthan9 Oct 1, 2025
15695c6
Fix MiniMaxAlgorithm setScores bug and add comprehensive tests (#6566)
yashsaha555 Oct 2, 2025
d8ddb07
Added Sum of Squares Lagrange's Four Square algorithm implementation …
BEASTSHRIRAM Oct 2, 2025
2be984f
To add Implementation of Base64 Algorithm (#6586)
NithinU2802 Oct 2, 2025
f43ecd5
feat: add comprehensive test coverage for ProcessDetails entity class…
yashsaha555 Oct 2, 2025
977c982
Add Minimum Window Substring algorithm in Sliding Window package (#6553)
Anubhav-pandey004 Oct 2, 2025
506b6d1
DEV: Implementing Time Conversion Algorithm (#6556)
BanulaKumarage Oct 2, 2025
8d14b49
Added CountBitsFlip algo (#6603)
the-yash-rajput Oct 3, 2025
7e29be3
Added isogram utility class and unit tests (#6594)
JeevaRamanathan Oct 3, 2025
6d51709
Dev: Added NumberPersistence utility class to find multiplicative and…
BanulaKumarage Oct 4, 2025
a0b6c52
Dev: Added algorithm to find the nth number in the Sylvester Sequence…
BanulaKumarage Oct 4, 2025
e6cb96f
Dev: Added CoordinateConverter for Cartesian and Polar coordinate con…
BanulaKumarage Oct 5, 2025
9484c7e
FEAT(geometry): Add Haversine formula and fix build issues (#6650)
Priyanshu1303d Oct 5, 2025
8ca2d9f
Create zero_one_bfs.java (#6560)
ananya-research Oct 6, 2025
9f985b2
feat: add euler primality test (#6680)
saahilmahato Oct 6, 2025
3eb521b
chore(deps): bump com.mebigfatguy.fb-contrib:fb-contrib from 7.6.14 t…
dependabot[bot] Oct 6, 2025
79dc71d
feat: add wu's line drawing algorithm (#6695)
saahilmahato Oct 7, 2025
74647e3
chore(deps): bump github/codeql-action from 3 to 4 in /.github/workfl…
dependabot[bot] Oct 8, 2025
c06dc29
feat(ciphers): Add PermutationCipher implementation(enhance #6697) (#…
dheeraj1010 Oct 8, 2025
596302b
chore(deps): bump gitpod/workspace-java-21 from 2025-08-25-18-17-39 t…
dependabot[bot] Oct 8, 2025
959ced9
Added mos algorithm and dice thrower (#6591)
BEASTSHRIRAM Oct 8, 2025
5f8d8ee
Added Pretty Display method and BSTRecursiveGenericTests.java (#6621)
UdayaKrishnanM Oct 8, 2025
b031a0b
Adding PiApproximation algo (#6602)
the-yash-rajput Oct 8, 2025
50b1bcd
feat: add damerau-levenshtein distance algorithm (#6706)
saahilmahato Oct 8, 2025
f9edb70
feat: add smith-waterman sequence alignment algorithm (#6708)
saahilmahato Oct 8, 2025
061463a
feat: add sieve of atkin algorithm (#6709)
saahilmahato Oct 8, 2025
4fe37c3
feat: add needleman–wunsch sequence alignment algorithm (#6707)
saahilmahato Oct 8, 2025
e22ce00
feat-Add MaximumProductSubarray (#6711)
Orthodox-64 Oct 9, 2025
b1aa896
Added GroundToGroundProjectileMotion (#6714)
the-yash-rajput Oct 9, 2025
16557a9
Feature iterative flood fill (#6584)
CrodiYa Oct 9, 2025
e788111
Dev: Added Germain and Safe prime utility class (#6611)
BanulaKumarage Oct 9, 2025
3c071c4
Added HappyNumber algorithm in maths section (#6571)
ruturajjadhav07 Oct 9, 2025
61fbb18
Dev: Add Zeller's Congruence utility class to calculate the day of th…
BanulaKumarage Oct 9, 2025
c691b31
chore(deps): bump com.puppycrawl.tools:checkstyle from 11.1.0 to 12.0…
dependabot[bot] Oct 10, 2025
69d8406
chore(deps): bump org.apache.maven.plugins:maven-pmd-plugin from 3.27…
dependabot[bot] Oct 10, 2025
f0fb971
refactor: Enhance docs, add tests in `PerlinNoise` (#6635)
Hardvan Oct 11, 2025
2a004a0
refactor: Enhance docs, code, add tests in `InsertDeleteInArray` (#6647)
Hardvan Oct 12, 2025
b5246c3
refactor: Enhance docs, code, add tests in `Huffman` (#6646)
Hardvan Oct 12, 2025
7fb4c8d
refactor: Enhance docs, code, add tests in `MinimaxAlgorithm` (#6641)
Hardvan Oct 12, 2025
c0ca704
refactor: Enhance docs, code, add tests in `PageRank` (#6642)
Hardvan Oct 12, 2025
14a23b7
refactor: Enhance docs, code, add tests in `LowestBasePalindrome` (#6…
Hardvan Oct 12, 2025
9a907c8
[FEAT] Implement Dials Algorithm (Graph) (#6679)
Priyanshu1303d Oct 12, 2025
74ddea6
refactor: Enhance docs, code, add tests in `KrishnaMurthyNumber` (#6742)
Hardvan Oct 12, 2025
bc7b656
feat: added TwoSat solutions with Tests, also updated Directory.md (#…
Shoyeb45 Oct 12, 2025
ff9fd2e
refactor: Enhance docs, code, add tests in `Median` (#6751)
Hardvan Oct 12, 2025
297634d
refactor: Enhance docs, code, add tests in `KaprekarNumbers` (#6747)
Hardvan Oct 12, 2025
387ecef
refactor: Enhance docs, code, add tests in `KeithNumber` (#6748)
Hardvan Oct 12, 2025
883a050
Added Dinic’s Max Flow algorithm with tests [Graphs] (#6762)
SamXop123 Oct 12, 2025
f30d101
refactor: Enhance docs, code, add tests in `LeonardoNumber` (#6743)
Hardvan Oct 13, 2025
8b8434c
feat(graph): Add Edmonds's algorithm for minimum spanning arborescenc…
Microindole Oct 13, 2025
8726d40
Add Yen’s K-shortest loopless paths with tests [GRAPHS] (#6773)
SamXop123 Oct 13, 2025
3c61271
chore(deps): bump com.puppycrawl.tools:checkstyle from 12.0.0 to 12.0…
dependabot[bot] Oct 14, 2025
87ad52c
chore(deps): bump org.jacoco:jacoco-maven-plugin from 0.8.13 to 0.8.1…
dependabot[bot] Oct 14, 2025
a935710
Add TortoiseHareAlgo implementation with append, toString, and getMid…
TejasSingh022 Oct 14, 2025
b316dcf
[FEAT] Implement Flattening MultiLevel LinkedList (#6670)
Priyanshu1303d Oct 14, 2025
b50d1d0
Added Sentinel Linear Search . (#6671)
Th-Shivam Oct 14, 2025
ce6f731
feat: Add RLE and Shannon-Fano compression algorithms (#6779)
Microindole Oct 14, 2025
219cc33
refactor: Enhance docs, code, add tests in `LinearDiophantineEquation…
Hardvan Oct 15, 2025
d62b438
refactor: Enhance docs, code, add tests in `HarshadNumber` (#6745)
Hardvan Oct 15, 2025
f460c60
refactor: Enhance docs, code, add tests in `HeronsFormula` (#6746)
Hardvan Oct 15, 2025
c6497a2
refactor: Enhance docs, code, add tests in `LucasSeries` (#6749)
Hardvan Oct 15, 2025
f8688ba
refactor: Enhance docs, code, add tests in `Means` (#6750)
Hardvan Oct 15, 2025
1437036
feat(graph): add Push–Relabel max flow with tests and index (#6793)
SamXop123 Oct 15, 2025
1a910b5
chore(deps): bump com.github.spotbugs:spotbugs-maven-plugin from 4.9.…
dependabot[bot] Oct 16, 2025
3519a91
Update DIRECTORY.md (#6546)
DenizAltunkapan Oct 16, 2025
fb5a765
feat: Add Hungarian Algorithm (Assignment Problem) with tests and ref…
SamXop123 Oct 16, 2025
e1773e9
Adding DampedOscillator code (#6801)
the-yash-rajput Oct 16, 2025
4858ec9
refactor: Enhance docs, code, add tests in `MaximumSumOfDistinctSubar…
Hardvan Oct 17, 2025
6b7d201
Hierholzer path algorithm (#6822)
quantambites Oct 17, 2025
b312567
feat: add DDA line drawing algorithm (#6616)
saahilmahato Oct 18, 2025
a7f0bab
Adding ElasticCollision2D (#6802)
the-yash-rajput Oct 19, 2025
4a97258
feat(compression): Add LZW and Arithmetic Coding algorithms (#6799)
Microindole Oct 19, 2025
d5289b9
Fix ConvexHull to return points in counter-clockwise order (#6810)
Microindole Oct 19, 2025
4de2254
chore(deps): bump com.puppycrawl.tools:checkstyle from 12.0.1 to 12.1…
dependabot[bot] Oct 21, 2025
873dd97
chore(deps): bump com.github.spotbugs:spotbugs-maven-plugin from 4.9.…
dependabot[bot] Oct 21, 2025
8930369
Added SimplePendulumRK4 (#6800)
the-yash-rajput Oct 21, 2025
f66da5e
refactor: Enhance docs, add tests in `PrintMatrixInSpiralOrder` (#6636)
Hardvan Oct 22, 2025
48ba1ae
feat(compression): Add LZ77 and LZ78 algorithms (#6910)
Microindole Oct 23, 2025
ab65ac6
feat(compression): Add Burrows-Wheeler Transform (BWT) and Move-to-Fr…
Microindole Oct 25, 2025
e21aee8
[FEAT] Add Newton's Law of Gravitation algorithm (#6855)
Priyanshu1303d Oct 25, 2025
2521556
[FEAT] Add general purpose Projectile Motion algorithm (Physics) (#6928)
Priyanshu1303d Oct 25, 2025
2da0465
feat(geometry): Add Bentley-Ottmann algorithm for line segment inters…
Microindole Oct 25, 2025
0cdbc58
chore: add workflow to close stale PRs with failed workflows (#6927)
DenizAltunkapan Oct 26, 2025
a4cf6e3
test: Add comprehensive tests for JugglerSequence (#6947)
krishna-medapati Oct 26, 2025
ae2e40a
Enhance stale PR auto-close to handle failed workflows (#6951)
DenizAltunkapan Oct 26, 2025
21eff8a
Added binary string to decimal converter (#6915)
TaranjeetSinghKalsi Oct 26, 2025
55da3b9
chore(deps): bump com.puppycrawl.tools:checkstyle from 12.1.0 to 12.1…
dependabot[bot] Oct 27, 2025
14a0de4
chore(deps): bump actions/github-script from 7 to 8 in /.github/workf…
dependabot[bot] Oct 28, 2025
3c70a54
feat: Add Neville's Algorithm (#6842)
Keykyrios Oct 28, 2025
68746f8
feat: Add Chebyshev Iteration algorithm (#6963)
Keykyrios Oct 28, 2025
bb6385e
feat: Add Stoer-Wagner Algorithm for Minimum Cut (#6752)
sairamsharan Oct 29, 2025
dfd8d69
Added surface area calculation for pyramid (#6853)
JonathanButterworth Oct 30, 2025
bf8cc61
chore(deps): bump org.junit:junit-bom from 6.0.0 to 6.0.1 (#7019)
dependabot[bot] Nov 1, 2025
0837424
[FEAT] Add Coulomb's Law for electrostatics (#7017)
Priyanshu1303d Nov 1, 2025
d717ca4
feat: Add Hierholzer's Algorithm for Eulerian Circuits (#6726)
sairamsharan Nov 2, 2025
82ff14c
feat: Add BitRotate utility for circular bit rotations (#7011)
Yajunesh Nov 3, 2025
100462d
Added LU Decomposition Algorithm for matrix (#6834)
sourav-625 Nov 3, 2025
f0a437d
Workflow/close failed prs (#6960)
DenizAltunkapan Nov 3, 2025
5c965eb
chore: fix typos in src/test/java/com/thealgorithms/datastructures (#…
khanhkhanhlele Nov 5, 2025
2ff2849
chore: fix typos in src/main/java/com/thealgorithms/strings/Pangram.j…
khanhkhanhlele Nov 5, 2025
c42e73b
chore: fix typos in src/main/java/com/thealgorithms/others/MemoryMana…
khanhkhanhlele Nov 5, 2025
a3717f0
chore: fix typos in src/main/java/com/thealgorithms/others/IterativeF…
khanhkhanhlele Nov 5, 2025
08ee26f
chore: fix typos in src/main/java/com/thealgorithms/others/Implementi…
khanhkhanhlele Nov 5, 2025
d92ab9d
chore: fix typos in src/main/java/com/thealgorithms/others/GaussLegen…
khanhkhanhlele Nov 5, 2025
26b47cb
chore: fix typos in src/main/java/com/thealgorithms/others/BankersAlg…
khanhkhanhlele Nov 5, 2025
3b14d6d
chore: fix typos in src/main/java/com/thealgorithms/matrix/RotateMatr…
khanhkhanhlele Nov 5, 2025
1645f31
chore: fix typos in src/main/java/com/thealgorithms/maths/SieveOfAtki…
khanhkhanhlele Nov 5, 2025
f403ce6
chore: fix typos in src/main/java/com/thealgorithms/maths/BinomialCoe…
khanhkhanhlele Nov 5, 2025
500c526
chore: fix typos in src/main/java/com/thealgorithms/divideandconquer/…
khanhkhanhlele Nov 5, 2025
88c8e39
chore: fix typos in src/main/java/com/thealgorithms/divideandconquer/…
khanhkhanhlele Nov 5, 2025
b87b110
chore: fix typos in src/main/java/com/thealgorithms/datastructures/qu…
khanhkhanhlele Nov 5, 2025
19f0f0b
chore: fix typos in src/main/java/com/thealgorithms/conversions/Turki…
khanhkhanhlele Nov 5, 2025
dd01b35
chore: fix typos in src/main/java/com/thealgorithms/datastructures/gr…
khanhkhanhlele Nov 5, 2025
fab09e7
chore: fix typos in src/main/java/com/thealgorithms/datastructures/gr…
khanhkhanhlele Nov 5, 2025
8ae5747
chore: fix typos in src/main/java/com/thealgorithms/devutils/nodes/Tr…
khanhkhanhlele Nov 5, 2025
96304bd
chore: fix typos in src/main/java/com/thealgorithms/devutils/nodes/Si…
khanhkhanhlele Nov 5, 2025
65eeb55
chore: fix typos in src/main/java/com/thealgorithms/devutils/nodes/Si…
khanhkhanhlele Nov 5, 2025
d75a668
chore: fix typos in src/main/java/com/thealgorithms/datastructures/tr…
khanhkhanhlele Nov 5, 2025
0c277a1
chore: fix typos in src/main/java/com/thealgorithms/datastructures/he…
khanhkhanhlele Nov 5, 2025
8c8527c
chore: fix typos in src/main/java/com/thealgorithms/datastructures/tr…
khanhkhanhlele Nov 5, 2025
5323084
add CombinationSum and test (#6725)
Avaneeshakrishna Nov 5, 2025
7026641
chore: fix typos in src/main/java/com/thealgorithms/backtracking/Floo…
khanhkhanhlele Nov 5, 2025
147da38
chore: fix typos in src/main/java/com/thealgorithms/ciphers/AES.java …
khanhkhanhlele Nov 5, 2025
c7cb54e
chore: fix typos in src/main/java/com/thealgorithms/datastructures/tr…
khanhkhanhlele Nov 5, 2025
d28fee9
chore: fix typos in src/main/java/com/thealgorithms/dynamicprogrammin…
khanhkhanhlele Nov 5, 2025
d126fd5
Add Trapping Rainwater problem implementation (Two Pointer Approach) …
Arzoo1701 Nov 5, 2025
5a68ba9
chore: fix typos in some files (#7052)
khanhkhanhlele Nov 6, 2025
4951fb9
[FEAT] Add Kinematics (SUVAT) equations (#7053)
Priyanshu1303d Nov 6, 2025
2588af0
fix: Correct typo in ExponentialSearch filename (#7056)
imprince26 Nov 7, 2025
0a55165
chore(deps): bump com.mebigfatguy.fb-contrib:fb-contrib from 7.6.15 t…
dependabot[bot] Nov 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: MajorityElement (TheAlgorithms#6380)
* refactor: MajorityElement

* refactor: fix import ordering

---------

Co-authored-by: Deniz Altunkapan <[email protected]>
  • Loading branch information
alxkm and DenizAltunkapan authored Jul 15, 2025
commit dcb02c61dfadd6cab986c44c2999aec7fea7076a
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.thealgorithms.datastructures.hashmap.hashing;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* This class provides a method to find the majority element(s) in an array of integers.
Expand All @@ -18,13 +20,18 @@ private MajorityElement() {
* Returns a list of majority element(s) from the given array of integers.
*
* @param nums an array of integers
* @return a list containing the majority element(s); returns an empty list if none exist
* @return a list containing the majority element(s); returns an empty list if none exist or input is null/empty
*/
public static List<Integer> majority(int[] nums) {
HashMap<Integer, Integer> numToCount = new HashMap<>();
if (nums == null || nums.length == 0) {
return Collections.emptyList();
}

Map<Integer, Integer> numToCount = new HashMap<>();
for (final var num : nums) {
numToCount.merge(num, 1, Integer::sum);
}

List<Integer> majorityElements = new ArrayList<>();
for (final var entry : numToCount.entrySet()) {
if (entry.getValue() >= nums.length / 2) {
Expand Down