Back to Browse

Sequential Search in Data Structure in C Programming Language

39 views
Jun 23, 2021
15:44

The sequential search is also known as linear search. The sequential search is very simple search technique. Here, search start of first element and comparing with search element if search element in the list than search is stopped otherwise search is continue when ever search specific element of any list. If whole list is check and search element is not found than message appears search element is not found in list. The sequential search can be use on both array elements and also apply on linked list. The sequential searching can be applied to a sorted or an unsorted list. Here, we see the example of array elements. Index 0 1 2 3 4 4 2 6 9 8 x Address 1000 1002 1004 1006 1008 We are searching 9 element of array than searching start at first element. Step :1 we are comparing first element with our search element, but our search 9 and first element in array list is 4. So, do not match. Index 0 1 2 3 4 4 2 6 9 8 x Step :2 we are comparing second element with our search element, but our search 9 and second element in array list is 2. So, do not match. Index 0 1 2 3 4 4 2 6 9 8 x Step :3 we are comparing third element with our search element, but our search 9 and third element in array list is 6. So, do not match. Index 0 1 2 3 4 4 2 6 9 8 x Step :4 we are comparing forth element with our search element, but our search 9 and fourth element in array list is 9. Here, match is found and searching stop at list element. Index 0 1 2 3 4 4 2 6 9 8 x Advantages of Sequential searching as follow: 1. It is very simple searching technique. 2. It is very easy to implementation when list are small. 3.It is works on both sorted and unsorted list. Disadvantages of Sequential searching are as follow: 1. Large list not handing by this searching technique. 2. It is very slower searching technique for large list.

Download

0 formats

No download links available.

Sequential Search in Data Structure in C Programming Language | NatokHD