subject
Engineering, 06.05.2020 07:31 mikeeway33

Suppose you have an array of n items (the "member items") and a separate list of k items (the "test items"). The member items are not stored in any particular order. You want to know which of the k test items belong to the set of member items. Here are two different ways to solve the problem: .

Algorithm 1: Look up each test item in the array of member items, using sequential search. .
Algorithm 2: Sort the array of member items, using an optimal comparison- based sorting algorithm, and then look up each test item in the array of member items using binary search Answer the following questions, and briefly justify your answer to each part.

(a) What is the worst-case running time of Algorithm 1 (asymptotically, in terms
(b) What is the worst-case running time of Algorithm 2 (asymptotically, in terms
(c) For a given value of n, for what values of k is Algorithm 2 at least as efficient as of n and k)? of n and k)? Algorithm 1?

ansver
Answers: 3

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Fluids at rest possess no flow energy. a)- true b)- false
Answers: 3
question
Engineering, 04.07.2019 18:10
Consider a large isothermal enclosure that is maintained at a uniform temperature of 2000 k. calculate the emissive power of the radiation that emerges from a small aperture on the enclosure surface. what is the wavelength ? , below which 10% of the emission is concentrated? what is the wavelength ? 2 above which 10% of the emission is concentrated? determine the wavelength at which maximum spectral emissive power occurs. what is the irradiation incident on a small object placed inside the enclosure?
Answers: 2
question
Engineering, 04.07.2019 18:10
Water at 55c flows across a flat plate whose surface temperature is held constant at 95c. if the temperature gradient at the plate's surface for a given value of x is 18 c/mm, find a) local heat transfer coefficient. b) heat flux
Answers: 3
question
Engineering, 04.07.2019 18:10
The flow rate of air through a through a pipe is 0.02 m5/s. a pitot static tube is placed in the flow. the radius of the pitot static tube is 1 mm. assuming the flow to be steady and the air to be at 300k, calculate the difference in total and static pressure if the diameter of the pipe is: (a) d 0.1 m d 0.05 m (c) d 0.01 m
Answers: 2
You know the right answer?
Suppose you have an array of n items (the "member items") and a separate list of k items (the "test...
Questions
question
Mathematics, 19.11.2020 02:30
question
Mathematics, 19.11.2020 02:30
question
Mathematics, 19.11.2020 02:30
question
Mathematics, 19.11.2020 02:30
Questions on the website: 13722367