176 Commits

Author SHA1 Message Date
c8ecd23183 Constructors BigInteger and BigDecimal used to wrap primitives should never be used. (#3627)
Constructors BigInteger and BigDecimal used to wrap primitives should never be used.

Co-authored-by: Debasish Biswas <debasishbsws.abc@gmail.com>
2022-11-06 17:40:14 +05:30
cc17d60d5c Add unit tests for SimpleSubCipher (#3688) 2022-11-06 10:21:22 +00:00
1c7da7af25 Add LongDivision (#3691) 2022-11-06 12:18:14 +02:00
37a1659e18 Add HarshadNumberTest (#3722) 2022-11-03 12:59:13 +00:00
37db41fd6b Add AutomorphicNumber (#3735) 2022-11-03 12:55:48 +00:00
1a391c2fe9 Add ValidParentheses (#3689) 2022-11-01 19:26:13 +02:00
fea982d54d Create Atoi Function.java (#3756)
* Create MyAtoi.java

There is a method in C++, which converts String to an Integer, called Atoi function, this is my own implementation of this function.

* Update directory

* Update MyAtoi.java

* Create MyAtoiTest.java

* Update directory

* Update directory

* Update directory

* Update MyAtoi.java

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Debasish Biswas <debasishbsws.abc@gmail.com>
2022-11-01 16:34:14 +05:30
d418bbd1cf Created PerfectNumberTest.java & Added function in PerfectNumber.java (#3751)
* Added function in PerfectNumber.java

Added isPerfectNumber2() in PerfectNumber.java

* Created PerfectNumberTest.java

* fixed isPerfectNumber()

fixed bug in isPerfectNumber() for negative numbers

* fixed typo

Co-authored-by: Debasish Biswas <debasishbsws.abc@gmail.com>
2022-11-01 06:22:56 +00:00
9e7456a2a8 Add tests for merge sort (#3715) 2022-10-31 19:26:49 +00:00
3542f1c4c1 Add check if tree is symmetric or not (fixes #3471) (#3472)
Co-authored-by: Amit Kumar <akumar@indeed.com>
Co-authored-by: Andrii Siriak <siryaka@gmail.com>
2022-10-30 10:29:22 +02:00
23eec39a29 Fibonacci optimized using binet's formula (#3728)
* Fibonacci optimized using binet's formula

* Update Fibonacci.java

* Update Fibonacci.java

* updated changes

Co-authored-by: Debasish Biswas <debasishbsws.abc@gmail.com>
2022-10-30 09:26:08 +05:30
8efc71e609 Added functions in Perimeter.java (#3739)
* Added functions and removed main

* deleted perimeterTest.java

deleted perimeterTest.java to create PerimeterTest.java

* Recreated PerimeterTest.java

Renamed perimeterTest.java to PerimeterTest.java and added test cases

* deleted PerimeterTest.java

* Recreated PerimeterTest.java

Recreated PerimeterTest.java from perimeterTest.java
2022-10-30 09:22:25 +05:30
957f633c93 Added function and fixed bug in PerfectCube.java (#3655)
* Added another function to PerfectCube.java

Added another function to PerfectCube.java and fixed a testing mistake in line number 9

* Created PerfectCubeTest.java

Created PerfectCubeTest.java

* fixed PerfectCubeTest.java

* Fixed bug in PerfectCube.java

Fixed bug in PerfectCube.java in isPerfectCube() function for negative numbers. Now It gives the correct output for perfect negative numbers.

* removed main() in PerfectCube.java
2022-10-29 11:57:17 +05:30
5ab1b6c319 Created VolumeTest.java & Fixed Bugs in Volume.java (#3682)
* Fixed functions and removed main() in Volume.java

Fixed calculation errors in volumeSphere() and volumeHemisphere() functions and removed main() and changed functions access specifier from private to public

* Created VolumeTest.java

Created VolumeTest.java JUnit Tests for Volume.java

Co-authored-by: Debasish Biswas <debasishbsws.abc@gmail.com>
2022-10-28 00:35:59 +05:30
bd267bb7d8 Fixed error in Palindrome.java and gave semantic names to functions (#3643)
* fixed error and changed functions names

fixed error at line 57 and gave semantic names to functions with comments

* renamed functions

renamed functions to match with original functions' names in the file

* Updated TestCases

Updated TestCases and changed a function name

* Removed main() and changed function name

Removed main() and changed the function name from isPalindromeStringBuilder to isPalindrome

* fixed typo

Co-authored-by: Debasish Biswas <debasishbsws.abc@gmail.com>
2022-10-28 00:17:16 +05:30
acf7a86b96 Added function in Pangram.java (#3703)
* Added function in Pangram.java

Added isPangramIndexOf() function in Pangram.java

* Added Tests for new function

Added Tests for isPangramIndexOf() function

* fixed typo

* changed function name

* changed function name

Co-authored-by: Debasish Biswas <debasishbsws.abc@gmail.com>
2022-10-27 23:26:34 +05:30
b2393d62a0 Add Test case for EggDropping (#3687) 2022-10-27 20:52:45 +03:00
23949cac47 Add test case for BinaryToDecimal (#3684) 2022-10-27 20:40:08 +08:00
2c9edc95b8 Add test case for HexaDecimalToBinary (#3683) 2022-10-27 20:34:01 +08:00
a0d03e814a Update WordLadderTest.java & WordLadder.java (#3674) 2022-10-26 21:14:03 +08:00
eecec0f706 Add test case for LetterCombinationsOfPhoneNumber (#3662) 2022-10-26 16:38:24 +08:00
c9e1d96147 Fix typos (#3615)
Co-authored-by: Andrii Siriak <siryaka@gmail.com>
2022-10-26 07:40:06 +00:00
8c6ed9c240 Add unit test for RSA cipher (#3664) 2022-10-26 09:10:27 +08:00
f8897f166d Add unit tests for Caesar cipher (#3665)
Co-authored-by: Yang Libin <contact@yanglibin.info>
2022-10-26 09:01:35 +08:00
7ef75980d5 Add unit tests for Vigenere cipher (#3666) 2022-10-26 08:57:51 +08:00
fd3386a0db Removed extra loop in Anagram.java (#3654) 2022-10-25 12:19:03 +00:00
315e947c87 Add more tests (#3601) 2022-10-25 12:15:41 +00:00
6235fd6505 Add tests for Average (#3652) 2022-10-25 15:00:53 +03:00
d88b70113f Fix naming LinkList_sort -> LinkListSort (#3640) 2022-10-24 21:27:17 +03:00
1e16709680 Update README.md (#3362) 2022-10-23 05:59:40 +00:00
8d4b048cb3 Add LongestValidParenthesesTest (#3612) 2022-10-22 19:21:54 +00:00
ea05286c86 Add tests for PowerSum (#3603) 2022-10-22 19:11:40 +00:00
3ef3d761c6 Add DP Solution to Subset Count (#3580) 2022-10-20 19:51:54 +00:00
f2e0126469 Use GCM mode in AES (fixes #3324) (#3325) 2022-10-18 21:24:25 +03:00
8803b7f5e7 Add tests for Area (#3358) 2022-10-18 21:03:58 +03:00
ddcb5cfead Create test cases for SlowSort (closes #3361) (#3363) 2022-10-17 15:15:06 +00:00
8855cf9525 Optimize Hashmap implementation (#3533) 2022-10-17 14:36:09 +00:00
cdd12a128d Add Dual Pivot QuickSort (#3357) 2022-10-15 06:06:36 +00:00
efac505a6d Add twin prime (#3312) 2022-10-14 09:36:26 +00:00
c805437c0c Add tests for CountChar (#3334) 2022-10-12 18:42:24 +00:00
c59fc923bf Add fcfs scheduling (#3335)
Co-authored-by: Smiti <smmaheshwari@paypal.com>
2022-10-12 21:39:34 +03:00
911b98472c Add Tests for Dudeney Number (#3336) 2022-10-10 17:25:06 +00:00
8661d07276 Add sum without using any mathematical operators (#3473) 2022-10-10 20:19:01 +03:00
03a4832a7d Add an interface for matrix search algorithms (closes #3461) (#3464) 2022-10-09 14:45:36 +03:00
cce1dbd124 Add algorithm to search for an element in 2D array (#3306) 2022-10-09 12:23:36 +03:00
302db81bb8 Fixes #3323 Javadoc generation errors in backtracking algorithms (#3326) 2022-10-08 14:10:34 +03:00
471d2c0b5d Fix CircularBuffer and add unit tests (#3411) 2022-10-06 16:51:10 +08:00
e96f567bfc Format code with prettier (#3375) 2022-10-03 17:23:00 +08:00
e4eb99ff18 Add A5 Cipher (#3292) 2022-09-27 16:33:13 +00:00
8ca571d887 Add Collatz Conjecture (#3290) 2022-09-26 04:51:21 +00:00