Created
September 11, 2012 20:04
-
-
Save dLobatog/3701620 to your computer and use it in GitHub Desktop.
Sequential_search
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sequential_search(array, solution) | |
array.each_with_index do |element, index| | |
return index if element == solution | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment