Fix the insertion sort (#86)

* Fix LinkedList

* Fix the prepend method for the LinkedList

* Fix the remove method for the MinHeap

* Correct a comment

* Fix BST removal method

* Fix the findEdge method of the graph

* Fix the value returned by DisjointSet union

* Add recursive factorial function

* Fix the insertion sort
This commit is contained in:
m-maksyutin
2018-07-03 11:56:34 +03:00
committed by Oleksii Trekhleb
parent e3b482c5e6
commit d82958dea9

View File

@ -14,7 +14,7 @@ export default class InsertionSort extends Sort {
// Go and check if previous elements and greater then current one.
// If this is the case then swap that elements.
while (
array[currentIndex - 1] &&
array[currentIndex - 1] !== undefined &&
this.comparator.lessThan(array[currentIndex], array[currentIndex - 1])
) {
// Call visiting callback.