# 配列Aの区間[0, N)からkeyの位置を求める
linearSearch(A, N, key):
    for i ← 0 to N-1:
        if A[i] = key:
            return i     

    return NIL # 存在しない