answer.
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
Alex17521 [72]
2 years ago
7

3. (20 points) Suppose we wish to search a linked list of length n, where each element contains a key k along with a hash value

h(k). Each key is a long character string. How might we take advantage of the hash values when searching the list for an element with a given key?
Engineering
1 answer:
Gre4nikov [31]2 years ago
6 0

Answer:

Alternatively we produce a complex (hash) value for key which mean that "to obtain a numerical value for every single string" that we are looking for.  Then compare that values along the range of list, that turns out be numerical values so that comparison becomes faster.

Explanation:

Every individual key is a big character  so to compare every keys, it is required to conduct a quite time consuming string reference procedure at every node. Alternatively we produce a complex (hash) value for key which mean that "to obtain a numerical value for every single string" that we are looking for.  Then compare that values along the range of list, that turns out be numerical values so that comparison becomes faster.

You might be interested in
An electrical utility delivers 6.25E10 kWh of power to its customers in a year. What is the average power required during the ye
Sindrei [870]

Answer:

The overall Utility delivered to customers in a year 'U' = 6.25 X 10¹⁰Kwh

However, the average power P, required for a year, t  = ? Kw

Expressing their relationship, we will have

             U = P x t

Given t = 1 year = 24 x 365 hours (assume a year operation is 365 days)

          t = 8760 hours

P = \frac{62500000000}{8760}

P = 7134.7Kw

Hence, the average power required during the year is 7,135Kw

Now to calculate the energy used by the power plant in a year (in quads)?

Recall, Efficiency, η = Power Output/Power Input (100)

so, we have

η = P₀/P₁, given

0.45 = \frac{7134.7Kw}{P₁}

P₁ = 15,855Kw

the total energy E₁ used in a year = 15,855x24x365 = 138.89MJoules

So to convert this to quads, Note;

1 quads of energy = 10¹⁵ Joules

The total energy used is 0.000000139 quads

Now to find the cubic feet of natural gas required to generate this power?

Note: 0.29Kwh of Power generated  = 1 cubic feet of natural gas used

Since, the power plant generated = 62500000000Kwh

The cubic feet of natural gas used = \frac{62500000000}{0.29}

Hence, 2.155x10²⁰cubic feet of N.gas was used to generate this much power.

8 0
2 years ago
Write a method printShampooInstructions(), with int parameter numCycles, and void return type. If numCycles is less than 1, prin
kirill [66]

Answer:

// The method is defined with a void return type

// It takes a parameter of integer called numCycles

// It is declared static so that it can be called from a static method

public static void printShampooInstructions(int numCycles){

// if numCycles is less than 1, it display "Too few"

   if (numCycles < 1){

       System.out.println("Too few.");

   }

// else if numCycles is less than 1, it display "Too many"

    else if (numCycles > 4){

       System.out.println("Too many.");

   }

// else it uses for loop to print the number of times to display

// Lather and rinse

  else {

       for(int i = 1; i <= numCycles; i++){

           System.out.println(i + ": Lather and rinse.");

       }

       System.out.println("Done");

       

   }

}

Explanation:

The code snippet is written in Java. The method is declared static so that it can be called from another static method. It has a return type of void. It takes an integer as parameter.

It display "Too few" if the passed integer is less than 1. Or it display "Too much" if the passed integer is more than 4. Else it uses for loop to display "Lather and rinse" based on the passed integer.

8 0
2 years ago
A four-variable logic function that is equal to 1 if any three or all four of its variables are equal to 1 is called a majority
gulaghasi [49]

Answer:

1. Assumption

2.Truth Table

3.K-Map

4.Mapping and Final Expression

5 0
2 years ago
Consider a 1.80-m-tall man standing vertically in water and completely submerged in a pool. Determine the difference between the
defon

Answer:

17.658 kPa

Explanation:

The hydrostatic pressure of a fluid is the weight of a column of that fluid divided by the base of that column.

P = \frac{weight}{base}

Also, the weight of a column is its volume multiplied by it's density and the acceleration of gravity:

weight = \delta * v * g

Meanwhile, the volume of a column is the area of the base multiplied by the height:

V = base * h

Replacing:

P = \frac{\delta * base * h * g}{base}

The base cancels out, so:

P = \delta * h * g

The pressure depends only on the height of the fluid column, the density of the fluid and the gravity.

If you have two point at different heights (or depths in the case of objects submerged in water) each point will have its own column of fluid exerting pressure on it. Since the density of the fluid and the acceleration of gravity are the same for both points (in the case of hydrostatics density is about constant for all points, it is not the case in the atmosphere), we can write:

\Delta P = \rho * g * (h1 - h2)

We do not know at what depth the man of this problem is, but it doesn't matter, because we know the difference in height of the two points of interes (h1 - h2) = 1.8 m. So:

\Delta P = 9.81 \frac{m}{s^{2} } * 1000 \frac{kg}{m^3} * 1.8 m = 17658 Pa = 17.658 kPa

4 0
2 years ago
python Write a program that takes a date as input and outputs the date's season. The input is a string to represent the month an
kupik [55]

Answer:

month = input("Input the month (e.g. January, February etc.): ")

day = int(input("Input the day: "))

if month in ('January', 'February', 'March'):

season = 'winter'

elif month in ('April', 'May', 'June'):

season = 'spring'

elif month in ('July', 'August', 'September'):

season = 'summer'

else:

season = 'autumn'

if (month == 'March') and (day > 19):

season = 'spring'

elif (month == 'June') and (day > 20):

season = 'summer'

elif (month == 'September') and (day > 21):

season = 'autumn'

elif (month == 'December') and (day > 20):

season = 'winter'

print("Season is",season)

Explanation:

4 0
2 years ago
Other questions:
  • A gas metal arc welder is also known as a _____ welder.
    5·1 answer
  • As shown, a load of mass 10 kg is situated on a piston of diameter D1 = 140 mm. The piston rides on a reservoir of oil of depth
    9·1 answer
  • Water at 200C flows through a pipe of 10 mm diameter pipe at 1 m/s. Is the flow Turbulent ? a. Yes b. No
    7·1 answer
  • If the current on your power supply exceeds 500 mA it can damage the supply. Suppose the supply is set for 37 V. What is the sma
    9·1 answer
  • In a parallel one-dimensional flow in the positive x direction, the velocity varies linearly from zero at y = 0 to 32 m/s at y =
    8·1 answer
  • Define initial set and final set. Briefly discuss one method used to determine them. The following laboratory tests are performe
    12·1 answer
  • Refrigerant-134a is compressed from 2 bar, saturated vapor, to 10 bar, 90o C in a compressor operating at steady state. The mass
    11·1 answer
  • When encountering low visibility from rain or fog, you should use your ____.
    12·1 answer
  • Use the drop -down menus to select the appropriate question type. Picking between two possible alternatives: Showing an understa
    7·1 answer
  • George is replacing a burned out resistor in a circuit board. The board has a 10, a 20, and a 40 on resistor, all in parallel. W
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!