Linear Searching
Linear Searching
- Is the simplest searching method.
- Is also referred to as sequential search.
- Involves comparing the items sequentially with the elements in the list.
Implementing Linear Search
- The linear search would begin by comparing the required element with the first element in the list.
- If the values do not match:
- The required element is compared with the second element in the list.
- If the values still do not match:
- The required element is compared with the third element in the list.
- This process continues, until:
- The required element is found or the end of the list is reached.