Abstract

Linear search is the basic search algorithm used in data structures. If is also called as sequential search. Linear search is used to find a particular element in an array. It is not compulsory to arrange an array in any order (Ascending or Descending) as in the case of binary search. Linear search starts by sequentially scanning the elements in the array and if the element has been found, if will display the particular element and the index value of that element in that array. In this paper we present a novel searching algorithm Two Way Linear Search, which modified version of linear search algorithm and is based on comparing the elements from both ends.We have also compared the Two Way Linear search algorithm with Linear Search Algorithm. We used MATLAB 8.0 for implementation and Analysis of CPU time taken by both the algorithms. We have checked the algorithms with input sequences of lengths10000, 50000, 100000, and 5000000.Result shows that Two Way Searching Algorithm is working well for all input values and it takes lesser time if the element to be search is after the middle of the array, otherwise it takes same time as in case of linear search.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call