Talk:Linear search

From Wikipedia, the free encyclopedia

Pseudocode implementation:

Linear search looks like the following in pseudocode:

Input is a list L and a value V. L[x] will denote the xth element in L, which consists of N values, L[1], L[2], ..., L[N].

function linear-search(L,N,V) set index = 1 repeat while index <= N if L[index] = V return success end-if set index = index + 1 end-repeat return failure end-function


Does linear search (which is so simple it doesn't even deserve to be called an "algorithm") even DESERVE an article? --User:Juuitchan

Yes. It gets used and it gets called "linear search." People might not know what that is. It totally deserves a place in an encyclopedia. Graue

I agree that Linear Search deserves a Wikipedia article. However, most of the example implementations don't implement linear search, they simply call a stdlib function that (presumably) implements it. I mean, wouldn't it be silly if the examples given for the Quicksort article were all "sort array", "sort(array)", "qsort(array)"? -- Jon Harrop

[edit] VB

Is it possible to get a VisualBasic example of a linear search posted by someone with appropriate knowledge? Thanks.