1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
AVprozaik [17]
3 years ago
8

Say you have a random, unordered list containing 4096 four-digit numbers. Describe the most efficient way to: sort the list and

then search for 100 elements within the list, and analyze the expected run time for this specific list's sorting and searching.
Engineering
1 answer:
Debora [2.8K]3 years ago
6 0

Answer:

Answer explained below

Explanation:

It is given that numbers are four-digit so maximum value of a number in this list could be 9999.

So we need to sort a list of integers, where each integer lies between [0,9999].

For these given constraints we can use counting sort which will run in linear time i.e. O(n).

--------------------------------------------------------------------------------

Psuedo Code:

countSort(int numList[]) {

int count[10000];

count[i] = 0; for all i;

for(int num in numList){

count[num]+= 1;

}

return count;

}

--------------------------------------------------------------------------------

Searching in this count array will be just O(1).

E.g. Lets say we want to search if 3 was present in the original list.

Case 1: it was present in the original list:

Then the count[3] would have been incremented by our sorting algorithm. so in case element exists then count value of that element will be greater than 0.

Case 2: it was not present:

In this case count[3] will remain at 0. so in case element does not exist then count of that element will be 0.

So to search for an element, say x, we just need to check if count[x]>0.

So search is O(1).

Run times:

Sorting: O(n)

Search: O(1)

You might be interested in
Which alpha-numeric designator, systematically assigned at the time of manufacture, identifies the manufacturer, month, year, lo
Makovka662 [10]

An alpha-numeric designator which is systematically assigned at the time of manufacture, so as to identify the manufacturer, month, year, location, and batch is referred to as lot number.

<h3>What is a product?</h3>

A product can be defined as any physical object (tangible item) that is typically produced by a manufacturer so as to satisfy and meet the demands, needs or wants of every customer. Also, some examples of a product include the following:

  • Refrigerator
  • Television
  • Microwave oven
  • Pencil
  • Smartphone
  • Computer
  • Perfume

<h3>What is lot number?</h3>

A lot number can be defined as an alpha-numeric designator which is systematically designed and assigned at the time of manufacture, so as to identify the manufacturer, month, year, location, and batch.

Read more on products here: brainly.com/question/14308690

#SPJ1

8 0
2 years ago
Ma puteti ajuta cu un argument de 2 pagini despre inlocuirea garniturii de etansare de pe pistonul etrierului de franare la un a
Nitella [24]

Answer:

can you translate

Explanation:

what Is that?

4 0
3 years ago
can someone help me with this engineering mechanics homework, please? I tried to solve it, but I got so confused.​
marishachu [46]

Explanation:

Sum of forces in the x direction:

∑Fx = ma

Rx − 250 N = 0

Rx = 250 N

Sum of forces in the y direction:

∑Fy = ma

Ry − 120 N − 300 N = 0

Ry = 420 N

Sum of forces in the z direction:

∑Fz = ma

Rz − 50 N = 0

Rz = 50 N

Sum of moments about the x axis:

∑τx = Iα

Mx + (-50 N)(0.2 m) + (-120 N)(0.1 m) = 0

Mx = 22 Nm

Sum of moments about the y axis:

∑τy = Iα

My = 0 Nm

Sum of moments about the z axis:

∑τz = Iα

Mz + (250 N)(0.2 m) + (-120 N)(0.16 m) = 0

Mz = -30.8 Nm

6 0
3 years ago
What happens in double transverse wishbone front suspension when brakes are applied.
RideAnS [48]

Answer:

When the brakes are applied the in the typical double transverse wishbone front suspension,  it "drives" the car ground due to the setting of the link-type system pivot points on the lower wishbone are have parallel alignment to the road

Explanation:

In order to minimize the car's reaction to the application of the brakes, the front and rear pivot are arranged with the lower wishbone's rear pivot made to be higher than the front pivot as such the inclined wishbone torque results in an opposing vertical force to the transferred extra weight from the back due to breaking.

5 0
3 years ago
Air enters a tank through an area of 0.2 ft2 with a velocity of 15 ft/s and a density of 0.03 slug/ft3. Air leaves with a veloci
Mademuasel [1]

Answer:

please find attached.

Explanation:

4 0
3 years ago
Other questions:
  • Why research and development in Maintenance Engineering?
    6·1 answer
  • What is pixel's intensity ?​
    8·1 answer
  • Calculate the availability of a system where the mean time between failures is 900 hours and the mean time to repair is 100 hour
    15·1 answer
  • You can divide a surface by drawing a line through it
    9·2 answers
  • A vertical piston-cylinder device contains water and is being heated on top of a range. During the process, 10 kJ of heat is tra
    9·1 answer
  • What are supercapacitors ?
    13·2 answers
  • A capillary tube is immersed vertically in a water container. Knowing that water starts to evaporate when the pressure drops bel
    11·1 answer
  • Define, in words the following i relative humidity ii) dew point temperature
    7·1 answer
  • which systems engineering support discipline has the goal to ensure that support considerations are an integral part of the syst
    14·1 answer
  • Lets try to get to 100 sub before charismas day <br> Jordan Gracia 32 sub and 5 videos
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!