Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. Given the following array arr1[] then answer the question below: 591 17 11 6 20 19 38 6 3 4 5 7 8
1. Given the following array arr1[] then answer the question below: 591 17 11 6 20 19 38 6 3 4 5 7 8 0 4 2 2 9 a) Arri[4]= arr1 [2]+arr1[3] b) Arr1[5] /2=? c) Apply linear search to find if 11 exist in arr[] (show the steps) 2. Given the following array arr2[] then answer the question below: 7 10 22 24 31 38 42 46 68 72 10 2 0 1 2 3 4 5 6 7 8 9 a) Apply binary search to find if 72 exist in arr2[] (show the steps) b) Apply binary search to find if 1 exist in arr2[] (show the steps) 3. What is the time complexity of a binary search and linear search in best and worst cases? 4. Which will cause the shortest execution of a binary search and linear search? 5. If you had an ordered array of size 500, what is the maximum number of iterations required to find an element with binary search? 6. If you had an ordered array of size 500, what is the maximum number of iterations required to find an element with linear search? 7. What are the termination condition for binary search and linear search? 10 11
Step by Step Solution
★★★★★
3.49 Rating (166 Votes )
There are 3 Steps involved in it
Step: 1
1 Given the following array arr1 arr1 5 01 a Arr14 arr12 arr13 Since arr12 and arr13 are not defined it is not possible to evaluate this expression b Arr152 Since arr15 is not defined it is not possib...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started