📜  线性搜索的 JavaScript 实现 - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:32.638000             🧑  作者: Mango

代码示例1
Set found to false
Set position to −1
Set index to 0
while found is false and index < number of elements
    if list[index] is equal to search value
        Set found to true
        Set position to index
    else Add 1 to index
return position