Friday, October 16, 2009

Traversing Linear Arrays

Let A be a collection of data elements stored in the memory of the computer. Suppose we want to print the contents of each element of A or suppose we want to count the number of elements of A with a given property. This can be accomplished by traversing A, that is, by accessing and processing each element of A exactly once. The following algorithm traverses a linear array LA.

6.0 Searching in Arrays

Searching is a process which refers to the operation of finding the location (LOC) of a target item in given data. There are two possibilities with searching process. It is successful if ITEM is found, or unsuccessful otherwise. In context of arrays, we study a simple search process called linear or Sequential Search.

7.1 Linear or Sequential Search

An Algorithm and C Programme for sequential or linear search is given in
chapter 1.


2 comments: