sorting-visualiser/Algorithms/quicksort.js
//FUNCTION FOR SWAPPING ELEMENTS IN ARRAY
FUNCTION FOR SWAPPING ELEMENTS IN ARRAY
FUNCTION FOR SWAPPING ELEMENTS IN ARRAY
function swap(array, leftIndex, rightIndex) {
    var tempIndex = array[leftIndex].index;             
    array[leftIndex].index = array[rightIndex].index;   
    array[rightIndex].index = tempIndex;                
    var temp = array[leftIndex];
    array[leftIndex] = array[rightIndex];               
    array[rightIndex] = temp;
}
function swap ( array , leftIndex , rightIndex ) { var tempIndex = array [ leftIndex ] . index ; array [ leftIndex ] . index = array [ rightIndex ] . index ; array [ rightIndex ] . index = tempIndex ; var temp = array [ leftIndex ] ; array [ leftIndex ] = array [ rightIndex ] ; array [ rightIndex ] = temp ; }
FUNCTION FOR SWAPPING ELEMENTS IN ARRAY
FUNCTION FOR SWAPPING ELEMENTS IN ARRAY
//we swap the index property of the column/bar object, //this helps keep track of what we're targeting //when it comes to animating. //this is swapping the actual objects in the array.