275 Commits

Author SHA1 Message Date
52f365a915 Add Index Of Right Most Set Bit Test (#4325)
* add Index Of Right Most Set Bit Test

* clang linter solved
2023-08-23 11:14:53 +05:30
4bcddd323c Add Preemptive Priority Scheduling Algorithm (#4323) 2023-08-20 19:40:23 +00:00
af80c8005d Add Sliding Window Problem (#4322) 2023-08-18 14:08:40 +00:00
b61faf4ede Is power two algo added. (#4321)
* is power two algo added

* Linter solved

* Update src/main/java/com/thealgorithms/bitmanipulation/IsPowerTwo.java

* Update src/test/java/com/thealgorithms/bitmanipulation/IsPowerTwoTest.java

---------

Co-authored-by: BamaCharanChhandogi <b.c.chhandogi@gmailcom>
Co-authored-by: Debasish Biswas <debasishbsws.dev@gmail.com>
2023-08-18 12:53:09 +00:00
68fdec5977 Add Tests for PancakeSort (#4318) 2023-08-16 18:57:36 +03:00
ac14411b39 Add Tests for GnomeSort (#4315) 2023-08-15 16:39:12 +00:00
2c16c86054 Add Numbers Have Different Signs (#4317)
Co-authored-by: BamaCharanChhandogi <b.c.chhandogi@gmailcom>
2023-08-15 19:36:00 +03:00
18848574be Make DFS and BFS search algorithms generic (fixes #4229) (#4230) 2023-08-13 11:59:26 +05:30
1ef700e850 Add IsEven Algorithm (#4301)
Co-authored-by: BamaCharanChhandogi <b.c.chhandogi@gmailcom>
2023-08-12 23:06:39 +03:00
251157059c Add Reverse Bits Algo in Bit-Manipulation (#4299)
Co-authored-by: BamaCharanChhandogi <b.c.chhandogi@gmailcom>
2023-08-12 15:55:10 +00:00
07945c7704 Add StrobogrammaticNumber (#4278) 2023-08-11 12:22:14 +00:00
4fe419ebd8 Add Recursive Reverse of Linked List (#4292)
Co-authored-by: BamaCharanChhandogi <b.c.chhandogi@gmailcom>
2023-08-10 11:38:56 +03:00
1ef5208b75 Add M-coloring Problem (#4282)
Co-authored-by: BamaCharanChhandogi <b.c.chhandogi@gmailcom>
Co-authored-by: Andrii Siriak <siryaka@gmail.com>
Co-authored-by: Debasish Biswas <debasishbsws.abc@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-08-05 22:00:26 +03:00
c4a9ef1566 Add PowerOfTwoOrNotTest (#4279) 2023-08-04 12:31:47 +00:00
ee23b6c2e5 Add tests for GenericRoot (#4276) 2023-08-03 23:14:59 +03:00
f83008d80a Refactor factorial, add unit tests (#4266) 2023-07-28 22:02:04 +03:00
fc274c84f8 Fix style in AmicableNumbers (#4263) 2023-07-26 16:52:46 +03:00
e5c7a08874 Handle inputs like "2 +" in StackPostfixNotation (#4262) 2023-07-26 14:11:28 +03:00
44dcebb699 Handle incorrect inputs in StackPostfixNotation (#4261) 2023-07-26 06:20:56 +00:00
dec3b98e4b Refactor FibonacciJavaStreams and add unit tests (#4260) 2023-07-25 22:42:09 +03:00
06ef351987 Add tests for SumOfArithmeticSeries (#4256) 2023-07-24 19:25:40 +03:00
2488a2ad51 Code cleanup (#4246) 2023-07-22 15:23:00 +00:00
4effd28d80 Add unit tests for Minimum Path Sum algorithm (#4233)
* Add unit tests for Minimum Path Sum algorithm

* fix lint issues

* fix lint issues

* fix clang lint issue
2023-07-09 22:54:00 +05:30
9ecc3aae59 Add a new implementation for CheckAnagrams (#4231) 2023-07-06 16:56:59 +03:00
2456d86432 Add unit tests for ParseInteger (#4228) 2023-07-02 11:31:55 +03:00
4b45ac7e71 Add unit tests for PalindromeNumber (#4227) 2023-07-01 18:29:10 +00:00
8862a4dea5 Add unit tests for FibonacciNumberCheck (#4225) 2023-07-01 20:52:52 +03:00
bc699b86e5 Refactor BinaryTreeIsBalanced algorithm (#4222) 2023-06-26 22:26:17 +08:00
05ca93eace Rename surfaceAreaTriangle for clarity (#4220) 2023-06-23 19:39:10 +03:00
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
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
87d6083bac Add tests for EulersFunction (#4216) 2023-06-19 20:46:54 +03:00
415a04ea7f Add automatic linter (#4214) 2023-06-09 20:05:14 +08:00
00282efd8b style: format code (#4212)
close #4204
2023-06-09 18:52:05 +08:00
ad03086f54 Remove main and add tests for CountWords (#4210) 2023-06-02 16:28:33 +00:00
22002c9939 Generalize NthUglyNumber (#4209) 2023-06-02 14:17:26 +03:00
4bbc4bd69f Refactor ReverseNumber (#4208) 2023-05-31 09:07:55 +03:00
b6e78a45ac Add Octal To Binary Converter (#4202) 2023-05-30 07:37:50 +00:00
5d7a59654f Refactor LowestBasePalindrome (#4207) 2023-05-29 23:05:23 +03:00
96c1a96647 Fix empty input handling in FindMax (#4206) 2023-05-28 23:45:13 +03:00
4f15149804 style: handle empty input array in FindMin.findMin (#4205)
* tests: add test case with mininum not being at the beginning

* style: throw IllegalArgumentException when input is empty

* style: use enhanced for loop

* docs: update doc-str
2023-05-28 16:38:44 +05:30
e14b30b88c Fix empty input handling in GCD (#4199) 2023-05-27 17:58:56 +03:00
deef2ae445 Refactor CreateBinaryTreeFromInorderPreorder (#4190) 2023-05-14 14:52:30 +03:00
0255705388 Add WordSearch (#4189) 2023-05-12 22:44:16 +03:00
122f5e5556 Add Round Robin scheduling (#4184) 2023-05-10 16:04:55 +03:00
3109c11c59 Add Partition Problem (#4182) 2023-05-09 13:21:11 +03:00
3a593d5d3c Cover BSTRecursive with tests (#4180) 2023-05-06 21:10:33 +03:00
89b7ee42e6 Add one more solution for anagrams check (#4175) 2023-05-05 20:50:47 +03:00
bb830e9559 Add tests for TwoSumProblem and reduce duplication (fixes #4177) (#4176) 2023-05-02 20:03:21 +03:00
19bd2408ff Des (#4172)
* Update directory

* Add DES Encryption algorithm

* Update directory

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-04-30 20:19:14 +05:30