Skip to content

Instantly share code, notes, and snippets.

View emberlzhang's full-sized avatar

Ember Zhang emberlzhang

View GitHub Profile
# Put your answers here!
# Put your answers here!
@emberlzhang
emberlzhang / linear_search.rb
Created October 10, 2012 00:45 — forked from scottchiang/linear_search.rb
Solution for Linear Search with Scott
#linear search
def linear_search(object, array)
index = 0
mismatch = 0
while index < array.length
if object != array[index]
mismatch += 1
end