How we might use dfs to locate vertices in a graph

Assignment Help Data Structure & Algorithms
Reference no: EM131058743

1. Describe how we might use DFS to locate vertices in a graph who are not connected to any other vertex in the graph.

2. Suppose we use DFS on a binary search tree, starting with the root. The edge to a left child is always traversed before an edge to a right child. In what order are the vertices visited? In what order are the vertices finished?

3. An undirected graph contains a "cycle" (i.e., loop) if there are two different simple paths by which we can get from one vertex to another. Using breadth-first search (not DFS), how can we tell if an undirected graph contains a cycle?

4. Let ???? = ????1????2···???????? and ???? = ????1????2···???????? be two strings over the alphabet Σ={????,????,????,????}. A longest common subsequence (LCS) of X and Y can be found by dynamic programming. To compute ????[????; ????], where 1≤????≤???? and 1≤????≤????, how many table entries are examined in the worst case?

5. Calculate the minimum number of multiplications necessary to find the matrix product ABCDE.

The dimensions of each of the matrices are listed below:

Matrix           Dimensions

A                       2x4

B                       4x3

C                       3x2

D                       2x5

E                       5x1

A 2 dimensional grid is provided below.

 

A

B

C

D

E

A

0

 

 

 

 

B

X

0

 

 

 

C

X

X

0

 

 

D

X

X

X

0

 

E

X

X

X

X

0

6. A directed graph G has four vertices, A, B, C, and D and the adjacency matrix below:

 

A

B

C

D

A

0

7

-1

4

B

3

0

5

C

4

0

D

1

0

Show the updates to the shortest path estimates when allowing just vertex A as an intermediate vertex in

Floyd-Warshall's algorithm. The non-trivial values have been left for you to fill in.

 

A

B

C

D

A

0

7

-1

4

B

3

0

 

 

C

 

0

 

D

 

 

0

Reference no: EM131058743

Questions Cloud

Angular momentum with respect : A pitcher throws a ball past a stationary batter. If the ball has no spin and is thrown straight, then will the ball has no angular momentum with respect to the batter?
Forces of equal magnitude and opposite direction : If two ends of a rope are pulled with forces of equal magnitude and opposite direction does the tension at the center of the rope must be zero? Explain?
Kinds of casual searches wikipedia : Most people have heard of Wikipedia and many have used it at some point for casual research. Refresh your knowledge of how Wikipedia works and provide a brief description in your posting.
System comprising the water and the iceberg : A 3100-kg iceberg at 0 °C falls into the ocean at a location where the water temperature is 2 °C, and all the ice melts by absorbing thermal energy from the water. For ice, the specific transformation energy for melting is 334 kJ/kg. What is the e..
How we might use dfs to locate vertices in a graph : Describe how we might use DFS to locate vertices in a graph who are not connected to any other vertex in the graph.
Base did the diver hit the water : A diver running 2.5 m/s dives out horizontally from the edge of a vertical cliff and 3.0 s later reaches the water below. How high was the cliff and how far from its base did the diver hit the water?
Identify symptoms of stress experienced by law enforcement : Identify the symptoms of stress experienced by law enforcement personnel and explain how the symptoms of stress experienced by law enforcement personnel impact their work.
Acceleration all have the same sign : During simple harmonic motion, is there a time at which the position, velocity, and acceleration all have the same sign (+,-, or 0)? Explain?
For natural science guru discussion 4 : Leaf through some popular magazine articles, examining introductory paragraphs until you find one that appeals to you. Describe it briefly.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Diagram of a telephone network

Consider a diagram of a telephone network, which is a graph G whose vertices represent switching centers, and whose edges represent communication lines joining pairs of centers. Edges are marked by their bandwidth, and the bandwidth of a path is the ..

  Provide definitions of all terms acronyms and abbreviations

Provide a description and scope of the software and explain the goals, objectives and benefitsof your project. This will provide the basis for the brief description of your product.

  Maekawa''s algorithm

Maekawa's Algorithm is used to achieve mutual exclusion for 13 sites. Suppose the sites are labeled 1, 2, ..., 13. Find the request sets R1, R2, ... , R13. Suppose sites 1, 6, 12 want to enter a critical section ( CS ) and they have sent requests in ..

  Js code to prompt the user for integer and print result

Write JS code which prompt the user for an integer and prints the result.

  Describe implementation of algorithm on simd computer

Describe an implementation of that algorithm on an SIMD computer where the processors are connected to form a linear array

  Develop a business systems plan

Develop a Business Systems Plan (with full justification as to how these are applicable for the organisation) so as to accommodate mobile access to various services provided by the hospital.

  Create two function for converting between units of distance

It's often necessary to convert between units. In this exercise, you will create two functions for converting between units of distance. The first function will be called ConvertMilesToKilometers(), which will accept one parameter for the number o..

  Linked lists give a program to implement the insert

give a program to implement the insert operation and delete operations on a queue using linked

  Write the algorithm which takes as input npda

Write the algorithm (described informally) which takes as input NPDA A and determines whether the language of A is nonempty.

  Development activities and configuration management

Development Activities and Configuration Management

  Describe why algorithm runs in linear time-adjacency matrix

Rreached from every other vertex. Describe why your algorithm runs in linear time (O(V2) on an adjacency matrix; O(E+V) on an adjacency list).

  What is a control statement there are several types of

control statementswhat is a control statement? there are several types of control statements define two control

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd