Homework Clinic

Science Clinic => Computer Science => Programming and Graphic Design => Topic started by: soccerdreamer_17 on Aug 30, 2020

Title: What kind of performance can you expect if you perform linear search on a sorted array?
Post by: soccerdreamer_17 on Aug 30, 2020

Question 1

What is the efficiency of binary search?
◦ n2 
◦ n
◦ log2 n
◦ n/2
◦ none of these

Question 2

What kind of performance can you expect if you perform linear search on a sorted array?
◦ The performance will be about the same as on an unsorted array
◦ The performance will be much better than on an unsorted array
◦ The performance will be much worse than on an unsorted array
◦ The performance will be worse than n2 in this case
◦ none of these
Title: What kind of performance can you expect if you perform linear search on a sorted array?
Post by: kaylee05 on Aug 30, 2020

Answer 1

log2 n

Answer 2

The performance will be about the same as on an unsorted array
Title: Re: What kind of performance can you expect if you perform linear search on a sorted array?
Post by: chaitanya kakarla on Dec 18, 2020
thank you