Question: Given an array arr = {30, 45, 48, 51, 67, 88,91} a) If target= 51 which searching algorithm is better (linear or binary search),

Given an array arr = {30, 45, 48, 51, 67, 88,91} a) If target= 51 which searching algorithm is better (linear or binary search), what is the time complexity of finding 51 with your chosen algorithm b) If target = 30 which searching algorithm is better (linear or binary search), what is the time complexity of finding 30 with your chosen algorithm c) If target=91 which searching algorithm is better (linear or binary search), what is the time complexity of finding 91 with your chosen algorithm d) Discuss the time complexity of Linear search algorithm when target is not found e) Discuss the time complexity of Binary search algorithm when target is not found
Step by Step Solution
3.38 Rating (164 Votes )
There are 3 Steps involved in it
Lets analyze each part of your question a If the target is 51 binary search is better in this case B... View full answer

Get step-by-step solutions from verified subject matter experts