Linear Search Algorithm (Sequential Search)
Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!
Step 1
Read the search element from the user
Step 5
Repeat steps 3 and 4 until the search element is compared with the last element in the list.
Step 3
If both are matching, then display "Given element found!!!" and terminate the function
Step 4
If both are not matching, then compare search element with the next element in the list.
Step 6
If the last element in the list is also doesn't match, then display "Element not found!!!" and terminate the function.
Step 2
Compare, the search element with the first element in the list.