mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-08 03:45:23 +08:00
Update linearSearch.js
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
/*
|
||||||
|
* Linear search or sequential search is a method for finding a target
|
||||||
|
* value within a list. It sequentially checks each element of the list
|
||||||
|
* for the target value until a match is found or until all the elements
|
||||||
|
* have been searched.
|
||||||
|
*/
|
||||||
function SearchArray(searchNum, ar) {
|
function SearchArray(searchNum, ar) {
|
||||||
var position = Search(ar, searchNum);
|
var position = Search(ar, searchNum);
|
||||||
if (position != -1) {
|
if (position != -1) {
|
||||||
|
Reference in New Issue
Block a user