Number of comparisons to search an element in a bitonic array
  • searching
  • sortedarray
  • array
  • bitonicarray
  • noOfComparisons
  •   
  • Posted: 4 years ago
  • Updated: 3 years ago
  • Edit
  • answers (1)
  • views (1799)

How many comparisons do you use in Search in a bitonic array , in the worst case?


Posted Answers

Number of comparisons to find the largest element, in the worst case = \( logn \).
Number of comparisons to find the element in the increasing part of the array = \( log(n_1) \).
Number of comparisons to find the element in the decreasing part of the array = \( log(n_2) \).
where \( n_1+n_2 = n \) = number of elements in the array
\( \therefore \) Total number of comparisons = \( 3logn \).

You need to Sign In to post your solution.