2451 Commits

Author SHA1 Message Date
1c978c52f1 feat: add karatsuba multiplication (#5719)
* feat: add karatsuba multiplication

* fix: fallback size

* fix: big integer instances

---------

Co-authored-by: Alex Klymenko <alexanderklmn@gmail.com>
2024-10-11 14:13:51 +00:00
0ca4398188 feat: Add RandomSearch new algorithm with Junit tests (#5701) 2024-10-11 16:58:34 +03:00
2338428578 Add cipher class, cipher tests, enhance docs in 'AtbashCipher.java' (#5690) 2024-10-11 06:05:26 +00:00
2040df88d9 Add Elliptic Curve Cryptography (#5700) 2024-10-11 05:47:36 +00:00
7326ab2c12 Add Space Optimized Solution to Subset sum problem (#5612) 2024-10-10 20:46:43 +00:00
79544c81eb feat: add solovay strassen primality test (#5692)
* feat: add solovay strassen primality test

* chore: add wikipedia link

* fix: format and coverage

* fix: mvn stylecheck

* fix: PMD errors

* refactor: make random final

---------

Co-authored-by: Alex Klymenko <alexanderklmn@gmail.com>
2024-10-10 23:41:58 +03:00
b1aeac5cd6 Add tests, remove main in UpperBound (#5679) 2024-10-10 20:36:06 +00:00
4ec2701302 Add tests, remove main in TernarySearch (#5677) 2024-10-10 20:32:32 +00:00
6802029251 Add tests, remove main in LinearSearchThread (#5671) 2024-10-10 23:29:20 +03:00
29ad197a64 Add tests, remove main in SaddlebackSearch (#5674) 2024-10-10 23:24:52 +03:00
e8b32513c8 Add tests, remove main in MonteCarloTreeSearch (#5673) 2024-10-10 23:20:39 +03:00
b1724fa737 Add tests, remove main in LinearSearch (#5670) 2024-10-10 23:12:07 +03:00
401d87365e Add tests, remove main in UnionFind (#5678) 2024-10-10 23:07:02 +03:00
fb11d455dd Add tests in SearchInARowAndColWiseSortedMatrix (#5675) 2024-10-10 23:02:13 +03:00
a663e66782 Add tests, remove main in SquareRootBinarySearch (#5676) 2024-10-10 22:57:40 +03:00
38285771c8 Add tests, remove main in JumpSearch (#5669) 2024-10-10 22:51:06 +03:00
f992fc425d Add tests, remove main in IterativeTernarySearch (#5668) 2024-10-10 22:45:26 +03:00
0a7065df38 Add tests, remove main in IterativeBinarySearch (#5667) 2024-10-10 22:41:07 +03:00
ba3d3bf54e Add tests, remove main, improve docs in InterpolationSearch (#5666) 2024-10-10 22:36:38 +03:00
d197fc7df2 Add tests, remove main, improve docs in ExponentialSearch (#5664) 2024-10-10 22:30:37 +03:00
a4e4319126 Add tests, remove main, improve docs in FibonacciSearch (#5665) 2024-10-10 22:26:16 +03:00
ca5fbbf0a9 Add tests, remove main in BinarySearch (#5663) 2024-10-10 22:22:42 +03:00
ac2c88ca9f Add tests, add IllegalArgumentException, remove main in `WineProb… (#5662) 2024-10-10 21:19:37 +03:00
c18dbc43b5 Add tests, add IllegalArgumentException in RodCutting (#5661) 2024-10-10 21:15:35 +03:00
41f7e6aa9d Add tests, improve docs in NewManShanksPrime (#5660) 2024-10-10 21:11:43 +03:00
44b0fc9408 Implement Maximum Sum of Non-Adjacent Elements (#5544) 2024-10-10 21:07:44 +03:00
c152c38d1b Update build.yml (#5709) 2024-10-10 21:03:56 +03:00
e728aa7d6f Add tests, remove main, enhance docs in MatrixChainMultiplication (#5658) 2024-10-10 20:16:04 +03:00
bd3b754eda Add EDFScheduling algorithm (#5657) 2024-10-10 19:56:44 +03:00
90d20b3a43 Add smoothing constant to IDF formula in BM25 to prevent negative scores (#5696)
Co-authored-by: prayas7102 <prayas.prithvirajpratap7@example.com>
Co-authored-by: Alex Klymenko <alexanderklmn@gmail.com>
2024-10-10 10:39:22 +03:00
d4fff30eaa feat : new bit manipulation algo Single element in an array (#5689)
* feat : new algo uniquesubseqcount

* Update UniqueSubsequencesCount.java

* Update UniqueSubsequencesCountTest.java

* Update UniqueSubsequencesCount.java

* Update UniqueSubsequencesCount.java

* Update UniqueSubsequencesCount.java

* Update UniqueSubsequencesCount.java

* Update UniqueSubsequencesCount.java

* Update UniqueSubsequencesCount.java

* Update UniqueSubsequencesCountTest.java

* Update UniqueSubsequencesCount.java

* Update UniqueSubsequencesCountTest.java

* Update UniqueSubsequencesCount.java

* Update UniqueSubsequencesCountTest.java

* Update UniqueSubsequencesCountTest.java

* Update UniqueSubsequencesCountTest.java

* Update UniqueSubsequencesCount.java

* feat : new bitmanipulation algo

---------

Co-authored-by: Alex Klymenko <alexanderklmn@gmail.com>
2024-10-10 10:32:02 +03:00
6535d4755d Add SwapAdjacentBits algorithm (#5634) 2024-10-09 23:02:41 +03:00
c0f35242a1 Add tests, remove print & main methods in BoundaryFill.java (#5640) 2024-10-09 22:56:51 +03:00
48c65e4c5e Add boundary traversal of binary tree (#5639) 2024-10-09 19:50:30 +00:00
f170078b8b Add Ones & Twos Complement in BitManipulation (#5604) 2024-10-09 22:45:15 +03:00
6e6028e3d0 Fix columnarTranspositionCipher and typos in Test (#5649) 2024-10-09 22:41:25 +03:00
029dd85646 Add tests, enhance docs in KadaneAlgorithm.java (#5646) 2024-10-09 22:36:00 +03:00
ce9f42081d Add tests, remove main, add negativity test in Fibonacci.java (#5645) 2024-10-09 22:20:45 +03:00
4a0e46dae6 Add tests, remove main in DiceThrow/DP.java (#5644) 2024-10-09 22:16:20 +03:00
6ddb26f48d Add tests, remove main & print methods in CoinChange.java (#5642) 2024-10-09 22:04:04 +03:00
2d34bc150f Optimised Space Complexity To O(sum) (#5651)
* Optimised Space Complexity To O(sum)

* Fixes Clang Format

* Optimised Space Complexity To Use a Single DP Array
2024-10-09 16:57:11 +03:00
0603accfd4 Add tests, remove main method, improve docs in BruteForceKnapsack (#5641) 2024-10-09 11:09:36 +03:00
49a87d3b58 Add tests for CountFriendsPairing (#5643) 2024-10-09 10:08:16 +03:00
4bcab89f05 Add JobSchedulingWithDeadline algorithm (#5608) 2024-10-09 06:33:39 +00:00
5c79e5de5d Add MedianOfTwoSortedArrays algorithm (#5554) 2024-10-09 08:56:08 +03:00
403649d404 Update CreateAndDetectLoop with tests (#5561) 2024-10-09 05:47:47 +00:00
b54cc21ade Add NumberAppearingOddTimes algorithm (#5633) 2024-10-08 21:42:24 +03:00
f3b2a94e74 Improve power sum algorithm (#5652)
* Update directory

* Improve PowerSum algorithm implementation and documentation

This commit enhances the PowerSum class in the backtracking package. The changes focus on improving code quality, readability, and documentation. Key improvements include:

1. Enhanced code structure and efficiency:
   - Removed class-level variables for better thread safety
   - Optimized the recursive approach to avoid unnecessary calculations
   - Simplified the overall logic for easier understanding

2. Improved readability:
   - Used more descriptive variable names (e.g., 'targetSum' instead of 'n', 'power' instead of 'x')
   - Enhanced method structure with a private recursive helper method

3. Better documentation:
   - Added comprehensive JavaDoc comments explaining the algorithm's purpose and implementation
   - Clarified the meaning of parameters, especially relating them to the original problem statement (N and X)
   - Improved inline comments for better code understanding

4. Adhered to Java best practices:
   - Improved encapsulation by making the recursive method private
   - Used Math.pow() directly instead of a custom power method

5. Maintained core functionality:
   - The algorithm still solves the same problem as before, but with improved code quality

* updated PowerSum

* Refactor PowerSum algorithm implementation and documentation

* Refactor PowerSum algorithm implementation and documentation

* Refactor code formatting and remove unnecessary line in PowerSum.java

* Refactor code formatting and add newline at end of file in .clang-format

---------

Co-authored-by: manishraj27 <manishraj27@users.noreply.github.com>
Co-authored-by: Bama Charan Chhandogi <b.c.chhandogi@gmail.com>
2024-10-08 23:59:29 +05:30
d437d581f4 Remove print & main methods (#5584) 2024-10-08 21:07:46 +03:00
ecd75c0c2e Add CrosswordSolver algorithm (#5626) 2024-10-08 21:00:02 +03:00