Function to sort the array order [ ] on the basis of the array freq [ ]
function merge ( order , freq , i , mid , j ) { var tempOrder = Array ( j - i + 1 ) ; var temp = mid + 1 , index = - 1 ; while ( i <= mid && temp <= j ) {