Abstract

For certain algorithms such as sorting and searching, the parameters of the input probability distribution, in addition to the size of the input, have been found to influence the complexity of the underlying algorithm. The present paper makes a statistical comparative study on parameterized complexity between linear and binary search algorithms for binomial inputs .

Highlights

  • Two of the popular search algorithms are linear search and binary search

  • In the present paper we investigate the effect of parameters n and p of a Binomial distribution input on the number of comparisons in linear search and binary search

  • Binomial variates are independently filled in an array of size k = 2000 and we make a linear search for an element which is in the array

Read more

Summary

Introduction

Two of the popular search algorithms are linear search and binary search. While linear search ( called sequential search) scans each array element sequentially, a binary search in contrast is a dichotomic divide and conquer search algorithm. In the present paper we investigate the effect of parameters n and p of a Binomial distribution input on the number of comparisons in linear search and binary search. It is observed that both the main effects n and p and the interaction effects n*p are highly significant for linear and significant but comparatively less for binary search. The result clearly suggests that apart from the size of the input, the parameters of the input distribution need be taken into account to explain the behavior of certain algorithms. In an earlier work on parameterized complexity, Anchala and Chakraborty [2] used factorial experiment to explain software complexity for insertion sort.

Results
Discussion
Conclusion
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