mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-06 01:18: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) {
|
||||
var position = Search(ar, searchNum);
|
||||
if (position != -1) {
|
||||
|
Reference in New Issue
Block a user