mirror of
https://github.com/TheAlgorithms/Ruby
synced 2024-12-28 22:24:14 +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
|
||||
end
|
||||
end
|
||||
|
||||
nil
|
||||
end
|
||||
|
||||
puts "Enter a sorted space-separated list:"
|
||||
arr = gets.chomp.split(' ').map(&:to_i)
|
||||
|
||||
puts "Enter the value to be searched:"
|
||||
value = gets.chomp.to_i
|
||||
|
||||
puts if binary_search(arr, value) != nil
|
||||
"Found at index #{binary_search(arr, value)}"
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue