Algorithms
Algorithms copied to clipboard
Using inherited swap method
Using inherited swap method from abstract class SortingAlgorithm.
Hi! @mavharsha
Using inherited swap method from abstract class SortingAlgorithm.
I can not see in SortingAlgorithm. Are you taking about this? Also did not get why Travis-ci fail? Can you help what test case is failing?
Hello @jsroyal ,
-
QuickSort extends SortingAlgorithm. https://github.com/pedrovgs/Algorithms/blob/master/src/main/java/com/github/pedrovgs/sortingalgorithm/SortingAlgorithm.java#L27 which has swap function.
-
The build failed because it is unable to sort (while loop in the partition function goes in an infinite loop) the give inputs. (When the inputs have duplicates) I modified an existing test rather than creating a new test.
Hope this clarifies.
- The build failed because it is unable to sort (while loop in the partition function goes in an infinite loop) the give inputs. (When the inputs have duplicates)
Input code twice with modified->
So I do not think this couse for travic build failed.
2.QuickSort extends SortingAlgorithm. https://github.com/pedrovgs/Algorithms/blob/master/src/main/java/com/github/pedrovgs/sortingalgorithm/SortingAlgorithm.java#L27 which has swap function.
Sorry! I just missed. BTW thanks for that -> PR.
Hey @jsroyal
Can you please run the QuickSortTest with modified input values against the code in master.
The code implementation in your screenshot isn't similar to QuickSort implementation in master. Thanks.
Oh! Sorry. Yeah, It is. Bug in code. And I thought it was my code but it seems not even the author name is mine. So yeah I will have to look it. Thanks @mavharsha
No worries! :)
Hey @mavharsha seems that you've found a bug! If the array contains duplicated values our quick sort implementation is not going to work due to an infinite loop! Now you've discovered the bug, could you fix it? It has to be a minor issue 😃
Sure @pedrovgs! (:
Thanks @mavharsha 😄