linear and binary search code Flashcards
1
Q
linear using a loop
A
function searchItem(dataItem)
count = 0
while count < 50
if dataArray(count) == dataItem then
return(count)
endif
count = count + 1
endwhile
return(-1)
endfunction