var data = [8, 3, 4, 1, 18, 22, 11, 3, 5, 6, 2, 1, 77] quickSort(data, 0, data.length - 1) console.log(data) var index = binarySearch(data, 18);console.log(index) function quickSort(data, left, right) { if(data.length < 2) { return; } var index = par…