Searching for a value
Linear/Sequential Search
PSEUDOCODE
Let L represent an array of values
Let n represent the size of the array
Let T represnet target value T,
Let i represent index of L
1. Set i to 0.
2. If L[i] = T, the search terminates successfully; return i.
3. If i < n, Increase i by 1 and go to step 2.
4. If i == n, the search terminates unsuccessfully.Binary Search
Linear vs Binary Search
Connected Reading
PreviousIs the dataset sorted?NextDetermine if the difference between an integer from the array and the target value exists
Last updated