Repeat Exercise R-14.28 for Figure 14.11 illustrating the Floyd-Warshall algorithm.Exercise R-14.28Describe the meaning of the graphical conventions used in Figure 14.9 illustrating a DFS traversal....
Recent Questions
1. Let T be the spanning tree rooted at the start vertex produced by the depth-first search of a connected, undirected graph G. Argue why every edge of G not in T goes from a vertex in T to one of...
Repeat Exercise R-14.28 for Figure 14.10 that illustrates a BFS traversal.Exercise R-14.28Describe the meaning of the graphical conventions used in Figure 14.9 illustrating a DFS traversal. What do...
Describe the meaning of the graphical conventions used in Figure 14.9 illustrating a DFS traversal. What do the line thicknesses signify? What do the arrows signify? How about dashed lines?Figure...
There are eight small islands in a lake, and the state wants to build seven bridges to connect them so that each island can be reached from any other one via one or more bridges. The cost of...
Repeat the previous problem for Kruskal’s algorithm.Exercise 14.25Draw a simple, connected, undirected, weighted graph with 8 vertices and 16 edges, each with unique edge weights. Illustrate the...
Draw a simple, connected, undirected, weighted graph with 8 vertices and 16 edges, each with unique edge weights. Illustrate the execution of the Prim-Jarn´ık algorithm for computing the minimum...
1. Draw a simple, connected, weighted graph with 8 vertices and 16 edges, each with unique edge weights. Identify one vertex as a “start” vertex and illustrate a running of Dijkstra’s algorithm on...
1. How many edges are in the transitive closure of a graph that consists of a simple directed path of n vertices?2. Given an n-node complete binary tree T, rooted at a given position, consider a...
If the vertices of the graph from Figure 14.11 are ordered as (JFK, LAZ, MIA, BOS, ORD, SFO, DFW), in what order would edges be added to the transitive closure during the Floyd-Warshall...
Draw the transitive closure of the directed graph shown in Figure 14.2.
Repeat Exercise R-14.28 for Figure 14.8 that illustrates a directed DFS traversal.Exercise R-14.28Describe the meaning of the graphical conventions used in Figure 14.9 illustrating a DFS traversal....
Compute a topological ordering for the directed graph drawn with solid edges in Figure 14.3d.Figure 14.3d
Let G be an undirected graph whose vertices are the integers 1 through 8, and let the adjacent vertices of each vertex be given by the table below:Assume that, in a traversal of G, the adjacent...
Recalling the definition of a complete graph from Exercise R-14.14, what does a breadth-first search tree of a complete graph look like?Exercise R-14.14A simple undirected graph is complete if it...
1. Explain why the DFS traversal runs in O(n2) time on an n-vertex simple graph that is represented with the adjacency matrix structure.2. A simple undirected graph is complete if it contains an...
In order to verify that all of its nontree edges are back edges, redraw the graph from Figure 14.8b so that the DFS tree edges are drawn with solid lines and oriented downward, as in a standard...
Would you use the adjacency matrix structure or the adjacency list structure in each of the following cases? Justify your choice.a. The graph has 10,000 vertices and 20,000 edges, and it is...
Can edge list E be omitted from the adjacency list representation while still achieving the time bounds given in Table 14.3? Why or why not?Table 14.3
Can edge list E be omitted from the adjacency matrix representation while still achieving the time bounds given in Table 14.1? Why or why not?Table 14.1
Repeat Exercise R-14.7 for the adjacency list representation, as described in the chapter.Exercise R-14.7Give pseudocode for performing the operation insertEdge(u, v, x) in O(1) time using the...
Bob loves foreign languages and wants to plan his course schedule for the following years. He is interested in the following nine language courses: LA15, LA16, LA22, LA31, LA32, LA126, LA127, LA141,...
1. Suppose we represent a graph G having n vertices and m edges with the edge list structure. Why, in this case, does the insertVertex method run in O(1) time while the removeVertex method runs in...
Draw an adjacency list representation of the undirected graph shown in Figure 14.1.Figure 14.1
Draw an adjacency matrix representation of the undirected graph shown in Figure 14.1Figure 14.1
1. Draw a simple undirected graph G that has 12 vertices, 18 edges, and 3 connected components.2. If G is a simple undirected graph with 12 vertices and 3 connected components, what is the largest...
1. Use the LCS algorithm to compute the best sequence alignment between some DNA strings, which you can get online from GenBank.2. Develop a spell-checker that uses edit distance (see Exercise...
Implement a search engine for the pages of a small Web site by adding a pageranking feature to the simplified search engine described in Section 13.3.4. Your page-ranking feature should return the...
Implement the simplified search engine described in Section 13.3.4 for the pages of a small Web site. Use all the words in the pages of the site as index terms, excluding stop words such as...
A very effective pattern-matching algorithm, developed by Rabin and Karp [54], relies on the use of hashing to produce an algorithm with very good expected performance. Recall that the brute-force...
1. Perform an experimental comparison of the relative speeds of the brute-force, KMP, and Boyer-Moore pattern-matching algorithms. Document the relative running times on large text documents that...
Draw a simple, connected, directed graph with 8 vertices and 16 edges such that the in-degree and out-degree of each vertex is 2. Show that there is a single (nonsimple) cycle that includes all the...
1. Perform an experimental analysis of the efficiency (number of character comparisons performed) of the brute-force and KMP pattern-matching algorithms for varying-length patterns.2. Perform an...
1. Write a program that takes two character strings (which could be, for example, representations of DNA strands) and computes their edit distance, based on your algorithm from the previous...
1. Give an efficient algorithm for determining if a pattern P is a subsequence (not substring) of a text T. What is the running time of your algorithm?2. Define the edit distance between two strings...
Let P be a convex polygon, a triangulation of P is an addition of diagonals connecting the vertices of P so that each interior face is a triangle. The weight of a triangulation is the sum of the...
Given a sequence S = (x0,x1,…,xn−1) of numbers, describe an O(n2)-time algorithm for finding a longest subsequence T = (xi0 ,xi1 ,…,xik−1 ) of numbers, such that ij j+1 and xij > xij+1 ....
A native Australian named Anatjari wishes to cross a desert carrying only a single water bottle. He has a map that marks all the watering holes along the way. Assuming he can walk k miles on one...
1. Implement a compression and decompression scheme that is based on Huffman coding.2. Design an efficient algorithm for the matrix chain multiplication problem that outputs a fully parenthesized...
Anna has just won a contest that allows her to take n pieces of candy out of a candy store for free. Anna is old enough to realize that some candy is expensive, while other candy is relatively...
Recent Comments