# 从数组 A 的区间 [0, N) 中找到 key 的位置 linearSearch(A, N, key): for i ← 0 to N-1: if A[i] = key: return i return NIL # 元素不存在