2. Contents
Definitions (Data, Structure, Data Structure, Search, Linear
search)
Example
Pseudocode
Advantages and disadvantages
Discussion
And Sources
Linear Search
Presentation on
3. What is data?
Data is a collection of facts, such as numbers, words,
measurements, observations or even just descriptions
of things.
Linear Search
Presentation on
5. What is data
structure?
data structure is a specialized format for organizing
and storing data.
Linear Search
Presentation on
6. What is search?
Search is the process of looking for something.
Linear Search
Presentation on
7. What is linear
search?
linear search or sequential search is a method for
finding a target value within a list. It sequentially checks
each element of the list for the target value until a
match is found or until all the elements have been
searched.
Linear Search
Presentation on
8. Linear search
example
If you are asked to find the name of the person having
phone number say “1234” with the help of a telephone
directory.
Since telephone directory is sorted by name not by
numbers,we have to go through each and every
number of the directory
Linear Search
Presentation on
9. Pseudocode
For all elements
Check if it is equal to element being searched
for.
If it is, return its position.
else continue.
Linear Search
Presentation on
11. Advantages
⦿ If the first number in the directory is the number you were
searching for ,then lucky you!!.
⦿ Since you have found it on the very first page,now its not
important for you that how many pages are there in the
directory.
⦿ Whether if it is of 1000 pages or 2000 pages it will take u
same time to find you the number ,if it is at the very
beginning .
.
Linear Search
Presentation on
12. Disadvantages
⦿ It may happen that the number you are searching for is the
last number of directory or if it is not in the directory at all.
⦿ In that case you have to search the whole directory.
⦿ Now number of elements will matter to you.if there are 500
pages ,you have to search 500;if it has 1000 you have to
search 1000.
Linear Search
Presentation on
13. Discussion
⦿ Sorted array is not needed.
⦿ Works fine for small number of elements .Search
time increases with number of elements.
⦿ Elements with higher probability of being searched
should be kept in the beginning.
Linear Search
Presentation on