Commit Graph

1948 Commits

Author SHA1 Message Date
Albina Gimaletdinova
351e85d264
Added same trees algorithm check with a unit test (#3845)
Co-authored-by: Debasish Biswas <debasishbsws.abc@gmail.com>
2023-01-13 20:07:56 +00:00
thanoskiver
44c05bf7db
Add Shortest Job First Scheduling (#3843) 2023-01-13 21:22:45 +02:00
Albina Gimaletdinova
3b6e3edbfb
Vertical order traversal refactoring, added unit test (#3844)
Vertical order traversal refactoring, added test
2023-01-13 19:26:15 +05:30
Albina
5aa417b6ae
Added Zigzag Traversal of a Binary Tree (#3811)
* Added Zigzag Traversal of a Binary Tree

* fixed file name

Co-authored-by: Albina Gimaletdinova <gimaletdinovaalbina@gmail.com>
2023-01-12 17:36:11 +05:30
Om Shinde
64181d6ea7
Remove unnecessary import (#3809) 2023-01-10 09:30:22 +02:00
Abinash Satapathy
9d86348cce
Update CONTRIBUTING.md (#3486) 2023-01-04 10:13:38 +02:00
Andrii Siriak
1aed52ba58
Trigger builds for all changes 2023-01-04 10:11:45 +02:00
Narek Karapetian
1eedaeb073
Move common tests for sorting algorithms to the base test class (#3782)
* bug fix for CircularBuffer + refactoring + add unit tests

* change Insertion sort to classical implementation + add isSorted function to SortUtils + add SortUtilsRandomGenerator for generating random values and arrays

* little fix

* move all common tests to SortingAlgorithmTest and utilize them

Co-authored-by: Debasish Biswas <debasishbsws.abc@gmail.com>
2023-01-01 14:50:56 +00:00
김준홍
ce55420418
Add tests for Tree Sort (#3787) 2022-12-31 19:09:09 +00:00
adrianparas
9123474729
Add Leftist Heap (#3789)
Co-authored-by: Adrian Paras <aparas@terpmail.umd.edu>
2022-12-29 12:19:35 +00:00
Tanmay Jadhav
6a0035d872
Add description for SkipList.java (#3503) 2022-12-28 12:01:05 +00:00
Nathan Cheshire
c6694fc1bd
Simplifying boolean returns (#3796)
* Simplifying boolean returns

* add comment back
2022-12-18 03:03:09 +00:00
David Leal
fb09eb289e
fix: bug report form error 2022-12-17 19:35:47 -06:00
David Leal
7fe9928ee8
docs: improve the issue forms (#3797)
* docs: improve the issue forms

* Update directory

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-12-17 18:58:52 +05:30
PuneetTri
5512fea0a8
Improve priority queues with max-heap (#3648) 2022-12-13 20:02:15 +02:00
Nishanth Chandra
8ba295b1ad
Added Order Agnostic Binary Search problem in Searches folder. (#3791)
* Added Order Agnostic Binary Search problem

* Update OrderAgnosticBinSearch.java

* Added JUnit Tests and removed redundant code.

* Made minor changes in JUnit Tests

* Removed tests for main folder and added docs.

* Added OrderAgnosticBinarySearchTest.java

* Renamed file to avoid errors.

* Updated the file to avoid build error
2022-12-12 00:43:27 +05:30
Hyun
219ec7c223
Create ShellSortTest (#3783)
Co-authored-by: Debasish Biswas <debasishbsws.abc@gmail.com>
2022-12-03 13:27:15 +00:00
Hyun
501aca3e31
Create SimpleSortTest (#3784) 2022-12-03 18:55:00 +05:30
Narek Karapetian
3f7e4d3f8f
Simplify Tim Sort (#3780) 2022-11-30 19:05:13 +02:00
Hyun
6c9090ffed
Create BucketSortTest (#3779)
* Create BucketSortTest

* Update src/test/java/com/thealgorithms/sorts/BucketSortTest.java

Co-authored-by: Debasish Biswas <debasishbsws.abc@gmail.com>

Co-authored-by: Debasish Biswas <debasishbsws.abc@gmail.com>
2022-11-28 15:15:06 +05:30
PuneetTri
27fc872edb
Add JUnit tests for priority queue data structure (#3778) 2022-11-27 19:56:16 +08:00
김준홍
bdfecbe1c1
Added test cases to CombSort. (#3776)
* Add testcase to CocktailShakerSort Algorithm

* fixed method name to lowerCamelCase

* Added test cases to OddEvenSortTest

* Added test case to CombSort
2022-11-26 15:20:53 +00:00
Narek Karapetian
7692e8f47d
Heap Sort: Simplify (#3777)
* bug fix for CircularBuffer + refactoring + add unit tests

* change Insertion sort to classical implementation + add isSorted function to SortUtils + add SortUtilsRandomGenerator for generating random values and arrays

* little fix

* simplify heap sort

* Update src/main/java/com/thealgorithms/sorts/HeapSort.java

* Update src/main/java/com/thealgorithms/sorts/HeapSort.java

Co-authored-by: Debasish Biswas <debasishbsws.abc@gmail.com>
2022-11-25 22:33:04 +05:30
Narek Karapetian
72468cc707
MergeSort: Simplify merge function (#3774)
* bug fix for CircularBuffer + refactoring + add unit tests

* change Insertion sort to classical implementation + add isSorted function to SortUtils + add SortUtilsRandomGenerator for generating random values and arrays

* little fix

* simplify merge function in MergeSort

* refactor one-liners

Co-authored-by: Debasish Biswas <debasishbsws.abc@gmail.com>
2022-11-25 03:54:17 +05:30
Debasish Biswas
260f1b2bee
Remove duplicate KnapsackMemoization (#3769) 2022-11-19 13:32:01 +02:00
김준홍
9f78d1fcf7
Added test cases to OddEvenSort. (#3768)
* Add testcase to CocktailShakerSort Algorithm

* fixed method name to lowerCamelCase

* Added test cases to OddEvenSortTest
2022-11-18 18:34:34 +05:30
김준홍
ac71f6eb79
Added test cases to CocktailShakerSort. (#3766)
* Add testcase to CocktailShakerSort Algorithm

* fixed method name to lowerCamelCase
2022-11-16 13:39:02 +05:30
Thanh-Thai Tran
f7dee0d958
Add tests for recursive merge sort (#3510) 2022-11-12 16:10:13 +00:00
Taranjeet Singh Kalsi
b294ddcb38
Add AliquotSum (#3765) 2022-11-11 21:57:18 +02:00
Arya Sen
9cde14095c
Fix BFS (#3759) 2022-11-09 19:40:20 +00:00
Hyun
4990f791a6
Add Bead Sort (#3761) 2022-11-09 19:33:30 +00:00
rnzit
b8d6b1a9b0
Create CRC16.java (#3733)
* Create CRC16.java

* Create CRC16Test.java
2022-11-09 10:20:54 +05:30
Dnyanesh Nimbalkar
eb375a6015
Fix spelling (#3444) 2022-11-07 18:31:44 +00:00
Akshay Dubey
b75dce17c3
algorithm: Square free integer (#3760)
* feat: Add square free integer implementation

Closes #3402

* test: Add unit tests for square free integer

Closes #3402

* fix: Fix failing build

Changed static import for assertEquals()
Closes #3402
2022-11-07 14:31:44 +05:30
Narek Karapetian
58cf08f2fd
Modify Insertion sort implementation to classical one + add function insertion-sentinel sort. (#3622)
* bug fix for CircularBuffer + refactoring + add unit tests

* change Insertion sort to classical implementation + add isSorted function to SortUtils + add SortUtilsRandomGenerator for generating random values and arrays

* little fix

Co-authored-by: Debasish Biswas <debasishbsws.abc@gmail.com>
2022-11-06 17:54:08 +05:30
kongleong86
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
Alexandre Velloso
cc17d60d5c
Add unit tests for SimpleSubCipher (#3688) 2022-11-06 10:21:22 +00:00
Aidar Djamalbek
1c7da7af25
Add LongDivision (#3691) 2022-11-06 12:18:14 +02:00
Taranjeet Singh Kalsi
37a1659e18
Add HarshadNumberTest (#3722) 2022-11-03 12:59:13 +00:00
Taranjeet Singh Kalsi
37db41fd6b
Add AutomorphicNumber (#3735) 2022-11-03 12:55:48 +00:00
Debasish Biswas
dfe733f777
Convert Issue Template to Issue form (#3641) 2022-11-01 17:40:55 +00:00
Aidar Djamalbek
1a391c2fe9
Add ValidParentheses (#3689) 2022-11-01 19:26:13 +02:00
Aidar Djamalbek
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
Taranjeet Singh Kalsi
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
Hyun
5864f3296f
Add BogoSort Tests (#3716) 2022-10-31 19:52:57 +00:00
shlokam
9e7456a2a8
Add tests for merge sort (#3715) 2022-10-31 19:26:49 +00:00
Amit Kumar
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
Aayush2111
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
Taranjeet Singh Kalsi
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
Taranjeet Singh Kalsi
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