International Journal of Computer Applications |
Foundation of Computer Science (FCS), NY, USA |
Volume 177 - Number 45 |
Year of Publication: 2020 |
Authors: Lakshay Goyal, Kunal Sharma, Tanu Rai, Bharat Gupta, Nitin Arora |
10.5120/ijca2020919939 |
Lakshay Goyal, Kunal Sharma, Tanu Rai, Bharat Gupta, Nitin Arora . Left-Right Mid Way Linear Searching Algorithm. International Journal of Computer Applications. 177, 45 ( Mar 2020), 22-26. DOI=10.5120/ijca2020919939
Searching on an element from a large set of data elements is always a time taking task. It becomes more challenging if the data set is random and is very large, having millions of items. Many searching techniques already exist like linear search, two-way linear search, etc. All the exiting algorithms have their best and worst performances depending upon the input cases. This paper proposed a new technique Left-Right midway (LRMW) linear search algorithm, which is based on the midway and then two-way method. The proposed algorithm works well in many types of input cases. The proposed algorithm, linear search algorithm, and two-way linear search algorithm is implemented in C language and tested on different size of input elements and time of execution is calculated for all the three algorithms for all input elements. Results show significant improvement if the data set is extensive and the required element is present nearby the middle element. The time complexity analysis of the proposed algorithm is also discussed in the paper.