mirror of
https://github.com/TheAlgorithms/Ruby
synced 2024-12-30 22:24:11 +01:00
Minor code style improvements
Tabs are corrected, semantic blocks are separated.
This commit is contained in:
parent
4fa7e1a672
commit
e6b674275e
1 changed files with 7 additions and 4 deletions
|
@ -13,13 +13,16 @@ else
|
||||||
front = middle + 1
|
front = middle + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
puts "Enter a sorted space-separated list:"
|
puts "Enter a sorted space-separated list:"
|
||||||
arr = gets.chomp.split(' ').map(&:to_i)
|
arr = gets.chomp.split(' ').map(&:to_i)
|
||||||
|
|
||||||
puts "Enter the value to be searched:"
|
puts "Enter the value to be searched:"
|
||||||
value = gets.chomp.to_i
|
value = gets.chomp.to_i
|
||||||
|
|
||||||
puts if binary_search(arr, value) != nil
|
puts if binary_search(arr, value) != nil
|
||||||
"Found at index #{binary_search(arr, value)}"
|
"Found at index #{binary_search(arr, value)}"
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue