Linear Search Algorithm (Sequential Search)

Ace your homework & exams now with 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.


Related study sets

Antihyperlipidemics and Peripheral Vasodilators Bile-Acid Sequestrant and Fibrate Therapy

View Set

Which of the following statements are true of the quantity weight?

View Set

Ch. 24- Asepsis and Infection Control

View Set

GENERAL INFO: Diffusion of Responsibility - The Bystander Effect (Darley & Latane, 1968)

View Set

AP Environmental Sciences - Unit 2

View Set

Abnormal psychology final review set 3

View Set

Sem 3 - Unit 5 - Premature Delivery - NCO

View Set

Different names of cities and provinces in the Philippines

View Set