mirror of
https://github.com/TheAlgorithms/Ruby
synced 2025-01-30 20:34:53 +01:00
Update Searches/jump_search.rb
This commit is contained in:
parent
2c1b0d9f77
commit
c3b26bed0a
1 changed files with 1 additions and 1 deletions
|
@ -43,6 +43,6 @@ 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
|
||||||
|
|
||||||
index = jumpsearch(arr, value)
|
index = jump_search(arr, value)
|
||||||
|
|
||||||
puts index == -1 ? "Element not found" : "Number #{value} is at #{index}"
|
puts index == -1 ? "Element not found" : "Number #{value} is at #{index}"
|
||||||
|
|
Loading…
Add table
Reference in a new issue