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
Need help with both giving out brainlest for the people to help me
sammy [17]
The first one is d or the 4th answer choice and the second one is false. Hope this helps!
4 0
2 years ago
How does java achieve portable
sergejj [24]

Answer:

Java is called portable because you can compile a java code which will spew out a byte-code, and then you run that code with Java Virtual Machine. Java Virtual Machine is like an interpreter, which reads the compiled byte-code and runs it. So first of all, you need to install the JVM on the system you want.

Explanation:

5 0
3 years ago
Each cout statement has a syntax error. Type the first cout statement, and press Run to observe the error message. Fix the error
saul85 [17]

Answer:

1. cout << "Num: " << songNum << endl;

2. cout << songNum << endl;

3. cout << songNum <<" songs" << endl;

Explanation:

//Full Code

#include <iostream>

using namespace std;

int main ()

{

int songNum;

songNum = 5;

cout << "Num: " << songNum << endl;

cout << songNum << endl;

cout << songNum <<" songs" << endl;

return 0;

}

1. The error in the first cout statement is that variable songnum is not declared.

C++ is a case sensitive programme language; it treats upper case and lower case characters differently.

Variable songNum was declared; not songnum.

2. Cout us used to print a Variable that has already been declared.

The error arises in int songNum in the second cout statement.

3. When printing more than one variables or values, they must be separated with <<

4 0
3 years ago
If your accelerator pedal gets stuck, what is the first thing you should do?
Anna35 [415]

If your accelerator gets stuck down, do the following: Shift to neutral. Apply the brakes. Keep your eyes on the road and look for a way out.If your accelerator gets stuck down, do the following:

Shift to neutral.

Apply the brakes.

Keep your eyes on the road and look for a way out.

Warn other drivers by blinking and flashing your hazard lights.

Try to drive the car safely off the road.

Turn off the ignition when you no longer need to change direction.

8 0
2 years ago
Cat is stuck in 10 foot hole how do i get it unstuck
Semenov [28]

Answer:

you fill the hole so there is no more cat

7 0
2 years ago
Read 2 more answers
Other questions:
  • A thin metal disk of mass m=2.00 x 10^-3 kg and radius R=2.20cm is attached at its center to a long fiber. When the disk is turn
    11·1 answer
  • Establishes general guidelines concerning licensing and vehicle
    10·2 answers
  • Two hemispherical shells of inner diameter 1m are joined together with 12 equally spaced bolts. If the interior pressure is rais
    15·1 answer
  • A 350 m^3 retention pond that holds rainwater from a shopping mall is empty at the beginning of a rainstorm. The flow rate out o
    7·1 answer
  • Air is to be heated steadily by an 8-kW electric resistance heater as it flows through an insulated duct. If the air enters at 5
    10·1 answer
  • How is air pressure affected by the shape of an aircraft wing
    14·1 answer
  • 1. A thin-walled cylindrical pressure vessel is capped at the end and is subjected to an internal pressure (p). The inside diame
    14·1 answer
  • Use the drop-down menus to complete the statements about using OneNote in Outlook meeting requests.
    15·1 answer
  • Write a program that takes three numbers as input from the user, and prints the largest.
    12·1 answer
  • A 7-hp (shaft) pump is used to raise water to an elevation of 15 m. If the mechanical efficiency of the pump is 82 percent, dete
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!