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
kvasek [131]
3 years ago
7

The time delay of a long-distance call can be determined by multiplying a small fixed constant by the number of communication li

nks on the telephone network between the caller and callee. Suppose the telephone network of a company named RT&T is a free tree. The engineers of RT&T want to compute the maximum possible time delay that may be experienced in a long-distance call. Given a free tree T, the diameter of T is the length of a longest path between two nodes of T. Give an efficient algorithm for computing the diameter of T.
Engineering
1 answer:
aliina [53]3 years ago
4 0

Answer:

We can compute the diameter of the tree T by a pruning procedure, starting at the leaves (external nodes).

  • Remove all leaves of T. Let the remaining tree be T1.
  • Remove all leaves of T1. Let the remaining tree be T2.
  • Repeat the "remove" operation as follows: Remove all leaves of Ti. Let remaining tree be Ti+1.
  • When the remaining tree has only one node or two nodes, stop! Suppose now the remaining tree is Tk.
  • If Tk has only one node, that is the center of T. The diameter of T is 2k.
  • If Tk has two nodes, either can be the center of T. The diameter of T is 2k+1.

Explanation:

We can compute the diameter of the tree T by a pruning procedure, starting at the leaves (external nodes).

  • Remove all leaves of T. Let the remaining tree be T1.
  • Remove all leaves of T1. Let the remaining tree be T2.
  • Repeat the "remove" operation as follows: Remove all leaves of Ti. Let remaining tree be Ti+1.
  • When the remaining tree has only one node or two nodes, stop! Suppose now the remaining tree is Tk.
  • If Tk has only one node, that is the center of T. The diameter of T is 2k.
  • If Tk has two nodes, either can be the center of T. The diameter of T is 2k+1.
You might be interested in
JAVA HADOOP MAPREDUCE
taurus [48]

Answer:

Explanation:

package PackageDemo;

import java.io.IOException;

import org.apache.hadoop.conf.Configuration;

import org.apache.hadoop.fs.Path;

import org.apache.hadoop.io.IntWritable;

import org.apache.hadoop.io.LongWritable;

import org.apache.hadoop.io.Text;

import org.apache.hadoop.mapreduce.Job;

import org.apache.hadoop.mapreduce.Mapper;

import org.apache.hadoop.mapreduce.Reducer;

import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;

import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;

import org.apache.hadoop.util.GenericOptionsParser;

public class WordCount {

public static void main(String [] args) throws Exception

{

Configuration c=new Configuration();

String[] files=new GenericOptionsParser(c,args).getRemainingArgs();

Path input=new Path(files[0]);

Path output=new Path(files[1]);

Job j=new Job(c,"wordcount");

j.setJarByClass(WordCount.class);

j.setMapperClass(MapForWordCount.class);

j.setReducerClass(ReduceForWordCount.class);

j.setOutputKeyClass(Text.class);

j.setOutputValueClass(IntWritable.class);

FileInputFormat.addInputPath(j, input);

FileOutputFormat.setOutputPath(j, output);

System.exit(j.waitForCompletion(true)?0:1);

}

public static class MapForWordCount extends Mapper<LongWritable, Text, Text, IntWritable>{

public void map(LongWritable key, Text value, Context con) throws IOException, InterruptedException

{

String line = value.toString();

String[] words=line.split(",");

for(String word: words )

{

Text outputKey = new Text(word.toUpperCase().trim());

IntWritable outputValue = new IntWritable(1);

con.write(outputKey, outputValue);

}

}

}

public static class ReduceForWordCount extends Reducer<Text, IntWritable, Text, IntWritable>

{

public void reduce(Text word, Iterable<IntWritable> values, Context con) throws IOException, InterruptedException

{

int sum = 0;

for(IntWritable value : values)

{

sum += value.get();

}

con.write(word, new IntWritable(sum));

}

}

}

3 0
2 years ago
Tech A says you can find the typical angle of a V-block engine by dividing the number of cylinders by 720
Lady_Fox [76]

Answer:

Tech A is correct

Explanation:

Tech A is right as its V- angle is identified by splitting the No by 720 °. Of the piston at the edge of the piston.

Tech B is incorrect, as the V-Angle will be 720/10 = 72 for the V-10 motor, and he says 60 °.

8 0
2 years ago
For a steel alloy it has been determined that a carburizing heat treatment of 11.3 h duration will raise the carbon concentratio
diamong [38]

This question is incomplete, the complete question is;

For a steel alloy it has been determined that a carburizing heat treatment of 11.3 h duration at Temperature T1 will raise the carbon concentration to 0.44 wt% at a point 1.8 mm from the surface. A separate experiment is performed at T2 that doubles the diffusion coefficient for carbon in steel.

Estimate the time necessary to achieve the same concentration at a 4.9 mm position for an identical steel and at the same carburizing temperature T2.

Answer:

the required time to achieve the same concentration at a 4.9 is 83.733 hrs

Explanation:

Given the data in the question;

treatment time t₁ = 11.3 hours

Carbon concentration = 0.444 wt%

thickness at surface x₁ = 1.8 mm = 0.0018 m

thickness at identical steel x₂ = 4.9 mm = 0.0049 m

Now, Using Fick's second law inform of diffusion

x^2 / Dt = constant

where D is constant

then

x^2 / t = constant

x^2_1 / t₁ = x^2_2 / t₂

x^2_1 t₂ = t₁x^2_2

t₂ = t₁x^2_2 / x^2_1

t₂ = (x^2_2 / x^2_1)t₁

t₂ = ( x_2 / x_1 )^2 × t₁

so we substitute

t₂ = ( 0.0049  / 0.0018  )^2 × 11.3 hrs

t₂ = 7.41 × 11.3 hrs

t₂ = 83.733 hrs

Therefore, the required time to achieve the same concentration at a 4.9 is 83.733 hrs

8 0
2 years ago
What impact does modulus elasticity have on the structural behavior of a mechanical design?
devlian [24]

Answer with Explanation:

The modulus of elasticity has an profound effect on the mechanical design of any machine part as explained below:

1) Effect on the stiffness of the member: The ability of any member of a machine to resist any force depends on the stiffness of the member. For a member with large modulus of elasticity the stiffness is more and hence in cases when the member has to resist a direct load the member with more modulus of elasticity resists the force better.

2)Effect on the deflection of the member: The deflection caused by a force in a member is inversely proportional to the modulus of elasticity of the member thus in machine parts in which we need to resist the deflections caused by the load we can use materials with greater modulus of elasticity.

3) Effect to resistance of shear and torque: Modulus of rigidity of a material is found to be larger if the modulus of elasticity of the material is more hence for a material with larger modulus of elasticity  the resistance it offer's to shear forces and the torques is more.

While designing a machine element since the above factors are important to consider thus we conclude that modulus of elasticity has a profound impact on machine design.

8 0
3 years ago
An aluminum alloy tube with an outside diameter of 3.50 in. and a wall thickness of 0.30 in. is used as a 14 ft long column. Ass
slega [8]

Answer:

slenderness ratio = 147.8

buckling load = 13.62 kips

Explanation:

Given data:

outside diameter is 3.50 inc

wall thickness 0.30 inc

length of column is 14 ft

E = 10,000 ksi

moment of inertia = \frac{\pi}{64 (D_O^2 -D_i^2)}

I = \frac{\pi}{64}(3.5^2 -2.9^2) = 3.894 in^4

Area = \frac{\pi}{4} (3.5^2 -2.9^2) = 3.015 in^2

radius = \sqrt{\frac{I}{A}}

r = \sqrt{\frac{3.894}{3.015}

r = 1.136 in

slenderness ratio = \frac{L}{r}

                              = \frac{14 *12}{1.136} = 147.8

buckling load = P_cr = \frac{\pi^2 EI}}{l^2}

P_{cr} = \frac{\pi^2 *10,000*3.844}{( 14\times 12)^2}

P_{cr} = 13.62 kips

3 0
3 years ago
Other questions:
  • What are the four processes of the Carnot cycle? Sketch the Carnot cycle (a) on T-s (temperature - entropy) and P-V (pressure -
    7·1 answer
  • Go online and search for information about companies that have been harmed or bankrupted by a disaster. Choose one such company
    11·1 answer
  • A stone-filled pit used for waste disposal is commonly referred to as a
    15·1 answer
  • Suppose you were a heating engineer and you wished to consider a house as a dynamic system. Without a heater, the average temper
    6·1 answer
  • The rate at which velocity changes is called?
    5·2 answers
  • The Ethernet (CSMA/CD) alternates between contention intervals and successful transmissions. Assume a 100 Mbps Ethernet over 1 k
    5·1 answer
  • Module 42 Review and Assessment
    7·1 answer
  • List three reasons for surfacing metals.
    8·2 answers
  • All of the following are examples of capital intensive industries EXCEPT: *
    15·2 answers
  • A company intends to market a new product and it estimates that there is a 20% chance that it will be first in the market
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!