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

  Program for stack by using dynamically allocated array

Write a C++ class which implements stack by using a dynamically allocated array. Initial size of particular stack must be determined when it is created.

  Splay tree and show the resulting tree

Insert 5, 1, 3, 6, 2, 4 into an initially empty splay tree and show the resulting tree - Can you provide some help with my Java language project? I hope someone nice out there can help me with it.

  Description a long time ago in a galaxy far far away the

description a long time ago in a galaxy far far away the country mafghanistan had n cities and m old roads where each

  Encryption feistel cipher and decryption algorithm

If this is psudocode for encryption feistel cipher determine decryption algorithm?Output: ciphertext = (left[16], right[16]) Explain pseudo-code of corresponding decryption algorithm for this cipher.

  find the minimum and maximum values in s

Given an array s =(s[1], s[2], . . . , s[n]), and n = 2^d for some d = 1. We want to find the minimum and maximum values in s. We do this by comparing elements of s.

  Count up the number of times that both arrays

Count up the number of times that both arrays have the same integer value at the same index.

  Create an algorithm that asks user for price of an item

Create an algorithm for a program that asks the user for the price of an item. The program then must display the given price, calculate and display the tax based on a 6% rate.

  Algorithm to categorize problem using big-theta notation

Find a simple algorithm for solving following problem and categorize it using big-theta notation: Divide the group of people into two disjoint subgroups (of arbitrary size) such that difference in total ages.

  Rewrite pseudocode of warshalls algorithm assuming that the

rewrite pseudocode of warshalls algorithm assuming that the matrix rows are represented by bit strings on which the

  Describe an algorithm that takes as input a list

Describe an algorithm that takes as input a list of n distinct integers and finds the location of the largest even integer in the list or returns 0 if there are no even integers in the list.

  Create the shoutbox class for your virtual world

Create the ShoutBox class for your Virtual World. Your ShoutBox class will have two methods - initialize your data structures with words or have the user enter the words

  Determine order of operations for seq search algorithm

Determine the order of operations for this Seq Search algorithm. Best case and worse case and why - Find the order of operations for this Search algorithm. Prepare a proper algorithm for this problem and how to complete it.

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