mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-12-19 06:58:15 +08:00
Complying with JavaScript Standard Style (npx standard --fix).
This commit is contained in:
@@ -49,7 +49,7 @@ function binarySearchIterative (arr, x, low = 0, high = arr.length - 1) {
|
||||
return -1
|
||||
}
|
||||
|
||||
export { binarySearchIterative, binarySearchRecursive}
|
||||
export { binarySearchIterative, binarySearchRecursive }
|
||||
|
||||
/* ---------------------------------- Test ---------------------------------- */
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ function exponentialSearch (arr, length, value) {
|
||||
return binarySearch(arr, value, i / 2, Math.min(i, length))
|
||||
}
|
||||
|
||||
export { binarySearch, exponentialSearch}
|
||||
export { binarySearch, exponentialSearch }
|
||||
|
||||
// const arr = [2, 3, 4, 10, 40, 65, 78, 100]
|
||||
// const value = 78
|
||||
|
||||
@@ -8,8 +8,7 @@ function SearchArray (searchNum, ar, output = v => console.log(v)) {
|
||||
const position = Search(ar, searchNum)
|
||||
if (position !== -1) {
|
||||
output('The element was found at ' + (position + 1))
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
output('The element not found')
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user