Search/Sorts algoruthms : remove live code & console.log, leave examples as comments.

This commit is contained in:
Eric Lavault
2021-10-11 12:29:03 +02:00
parent 8a7be96c9d
commit 74f296578a
22 changed files with 121 additions and 197 deletions

View File

@ -47,12 +47,8 @@ function exponentialSearch (arr, length, value) {
return binarySearch(arr, value, i / 2, Math.min(i, length))
}
const arr = [2, 3, 4, 10, 40, 65, 78, 100]
const value = 78
const result = exponentialSearch(arr, arr.length, value)
export { binarySearch, exponentialSearch}
if (result < 0) {
console.log('Element not found')
} else {
console.log('Element found at position :' + result)
}
// const arr = [2, 3, 4, 10, 40, 65, 78, 100]
// const value = 78
// const result = exponentialSearch(arr, arr.length, value)