Research Article

Two way Linear Search Algorithm

by  Nitin Arora, Garima Bhasin, Neha Sharma
journal cover
International Journal of Computer Applications
Foundation of Computer Science (FCS), NY, USA
Volume 107 - Issue 21
Published: December 2014
Authors: Nitin Arora, Garima Bhasin, Neha Sharma
10.5120/19137-9622
PDF

Nitin Arora, Garima Bhasin, Neha Sharma . Two way Linear Search Algorithm. International Journal of Computer Applications. 107, 21 (December 2014), 6-8. DOI=10.5120/19137-9622

                        @article{ 10.5120/19137-9622,
                        author  = { Nitin Arora,Garima Bhasin,Neha Sharma },
                        title   = { Two way Linear Search Algorithm },
                        journal = { International Journal of Computer Applications },
                        year    = { 2014 },
                        volume  = { 107 },
                        number  = { 21 },
                        pages   = { 6-8 },
                        doi     = { 10.5120/19137-9622 },
                        publisher = { Foundation of Computer Science (FCS), NY, USA }
                        }
                        %0 Journal Article
                        %D 2014
                        %A Nitin Arora
                        %A Garima Bhasin
                        %A Neha Sharma
                        %T Two way Linear Search Algorithm%T 
                        %J International Journal of Computer Applications
                        %V 107
                        %N 21
                        %P 6-8
                        %R 10.5120/19137-9622
                        %I Foundation of Computer Science (FCS), NY, USA
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.

References
  • Arora, N. , Tamta, V. , and Kumar S. 2012. A Novel Sorting Algorithm and Comparison with Bubble Sort and Selection Sort. International Journal of Computer Applications. Vol 45. No 1. 31-32
  • Herbert Schildt Tata McGraw-Hill
  • , "The Complete Reference C fourth Edition".
  • Alfred V. , Aho J. , Horroroft, Jeffrey D. U. (2002) Data Structures and Algorithms.
  • Frank M. C. (2004) Data Abstraction and Problem Solving with C++. US: Pearson Education, Inc.
  • Cormen T. H. , Leiserson C. E. , Rivest R. L. and Stein C. (2003) Introduction to Algorithms MIT Press, Cambridge, MA, 2nd edition.
  • Seymour Lipschutz (2009) Data Structure with C, Schaum Series, Tata McGraw-Hill Education.
Index Terms
Computer Science
Information Sciences
No index terms available.
Keywords

Searching Algorithms Linear Search Two Way Linear Search.

Powered by PhDFocusTM