Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upimplement jump searcher algorithm. #146
Conversation
Codecov Report
@@ Coverage Diff @@
## master #146 +/- ##
==========================================
+ Coverage 90.21% 92.82% +2.61%
==========================================
Files 69 15 -54
Lines 3220 1478 -1742
==========================================
- Hits 2905 1372 -1533
+ Misses 315 106 -209 Continue to review full report at Codecov.
|
|
Can anyone specify what changes should i make? I was not able to understand why merging is blocked |
|
Thanks for the search! Merging is blocked because stylecop rules aren't satisfied. Do you use an IDE? There should be warnings about that. |
| while (val > arr[Math.Min (step, arr.Length) - 1]) { | ||
| old = step; | ||
| temp = Math.Sqrt (arr.Length); | ||
| step += (int) Math.Floor (temp); |
siriak
Jun 12, 2020
Member
Modifying step is misleading and this variable isn't named correctly. The step should be fixed and the current position should be updated every iteration. Could you refactor this?
Modifying step is misleading and this variable isn't named correctly. The step should be fixed and the current position should be updated every iteration. Could you refactor this?
|
|
||
| while (val > arr[old]) { | ||
| old++; | ||
| if (old == Math.Min (step, arr.Length)) { |
siriak
Jun 12, 2020
Member
Same here, try to think of better names for all the variables
Same here, try to think of better names for all the variables
| /// Time compl is O(root(n)) | ||
| /// Note: the array has to be sorted beforehand. | ||
| /// </summary> | ||
| public class JumpSearcher { |
siriak
Jun 12, 2020
Member
Take a look at https://github.com/TheAlgorithms/C-Sharp/blob/master/Algorithms/Search/BinarySearcher.cs
Could this searcher be implemented to work with IComparable?
Take a look at https://github.com/TheAlgorithms/C-Sharp/blob/master/Algorithms/Search/BinarySearcher.cs
Could this searcher be implemented to work with IComparable?
beqakd
Jun 12, 2020
Author
Good point. I totally forgot to implement it.
Good point. I totally forgot to implement it.
|
I totally forgot, could you add some tests as well? See tests for other searchers for reference |
|
Thanks a lot for the review! Will do changes right away. |
Use the code style of this repository.Use block instead of block { Put a blank line under closed blocks. Exemple: block Method(); |
|
Complexity increasing per file
==============================
- Algorithms/Search/JumpSearcher.cs 6
See the complete overview on Codacy |
|
Closing because build fails, there are no tests, and code style isn't followed. |
Implement one of the most public searcher algorithm.
#145