Searching elements of an array using linear search





Algorithm:



Step1: start

Step2: read the array to a and element to be searched in j

Step3: Repeat step4 for all elements of the array

Step4: if(j==a[i])
       o=a[i]

Step5: if o==j, then print search result exist

Step6: else
       Print number not exist

Step7: stop


Comments

Popular posts from this blog

Node.js Cheat Sheet

Codeigniter ! Simple But Powerful

Enhancing Supply Chain Security and Cloud-Native Development with Chainguard