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
Leya [2.2K]
2 years ago
11

The complexity of bfs and dfs

Engineering
1 answer:
Lelechka [254]2 years ago
3 0

Answer:

BFS uses Queue to find the shortest path. DFS uses Stack to find the shortest path. ... Time Complexity of BFS = O(V+E) where V is vertices and E is edges. Time Complexity of DFS is also O(V+E) where V is vertices and E is edges.

Explanation:

You might be interested in
Applications of fleming hand rule
Eva8 [605]

Answer:

Fleming hand rule represents the direction of current in a generator's windings and induced current as a conductor is attached to a circuit such that it moves in a magnetic field.

Explanation:

Fleming hand rule represents the direction of current in a generator's windings and induced current as a conductor is attached to a circuit such that it moves in a magnetic field.

Fleming hand rule is used in the case of electric motors and electric generators.

Fleming hand rule is used to determine the following:

1. Direction of torque

2. Angular velocity

3. Angular acceleration

4 0
2 years ago
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
I don't know what is this​
pychu [463]
That means “ if possible then link”
8 0
3 years ago
How would you design a wheelchair for wheelchair-using basketball players? Would you make it more or less massive?
emmainna [20.7K]
Less, if it’s too big: hard to control and maneuverability for shooting wouldn’t be that good. a smaller wheelchair allows for faster movement and control, along with easier shooting and upper body movement
6 0
2 years ago
For the following circuit diagram, if A=010 , B= 101.
Fantom [35]

Answer:

cgghhhh chick jjkkkkkki

4 0
2 years ago
Other questions:
  • Joseph wants to practice architecture. Which compulsory assessment administered by NCARB does he need to complete?
    10·1 answer
  • In order to avoid slipping in the shop, your footwear should __
    10·2 answers
  • #5 Air undergoes an adiabatic compression in a piston-cylinder assembly from P1= 1 atm and Ti=70 oF to P2= 5 atm. Employing idea
    13·1 answer
  • Can a real refrigerator have higher COP than the COP of the Carnot refrigerator?
    7·2 answers
  • A designer needs to select the material for a plate under tensile stress. Assuming that the applied tensile force is 13,000 lb a
    5·1 answer
  • As an engineer which types of ethical issues or problem you can face in industrial environment.
    8·1 answer
  • In a hydraulic system, a 100.-newton force is applied to a small piston with an area of 0.0020 m2. What pressure, in pascals, wi
    13·1 answer
  • 1. You should
    11·2 answers
  • Which of the following is critical when performing maintenance?
    6·1 answer
  • QUICK ASAP
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!