Given the ordered list : {2,4,6,8,10,12} 5a) Using binary search, how MANY comparisons would be needed in order to sear

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Given the ordered list : {2,4,6,8,10,12} 5a) Using binary search, how MANY comparisons would be needed in order to sear

Post by answerhappygod »

Given the ordered list: {2,4,6,8,10,12}
5a) Using binary search,how MANY comparisons would beneeded in order to search for the item 4 in the list? For eachcomparison, write the index and the value of themiddle element (refer to the example below).
Your answer should be written in thefollowing format:-
Comparison 1 :
Middle element index =
Middle element value =
[7 marks]
5b) Suppose we will use sequential search to search foritem 4 in the same list. How many comparisons this willtake?
[1 mark]
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply