Logo 
Search:

C++ Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C++ ProgrammingRSS Feeds

Write an algorithm for Sequential Search in dfs (data file structure).

  Shared By: Billy Fischer    Date: Sep 21    Category: C++ Programming    Views: 3373

Answer:

1. Initialize searcharray, searchno, length.

2. Initialize pos=0.

3. Repeat step 4 till pos<=length.

4. if searcharray[pos]=searchno
return pos
else
increment pos by 1.

Share: 
 



Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: