# Assignment4_sol.pdf - CSC130 Assignment 4 Spring 2017 1....

• Homework Help
• 10

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 1 - 3 out of 10 pages.

CSC130Assignment 4Spring 20171. (10 Points) Show the contents of the id[] array after inserting each input pair using weighted quick-union, (0, 7), (1, 5), (7, 4), (4, 8), (4, 6), (3, 2), (2, 6), (6, 8), (8, 4), (5, 9). Draw the final forest of trees.Assuming set consists of numbers from 0 to 9.Answer:2. (5 Points) Suppose you use a stack instead of a queue when running breadth-first search. Does it stillcompute shortest paths?If so, provide a brief proof.If not, provide a counter example.))
##### We have textbook solutions for you!
The document you are viewing contains questions related to this textbook.
Chapter 1 / Exercise 107
Precalculus with Limits: A Graphing Approach
Larson
Expert Verified
CSC130Assignment 4Spring 20173. (5 Points) To find SPT for an edge-weighted digraph with negative edge weights, can we add a positiveconstant edge weight to each edge and make every edge weight to be positive, and then use Dijkstra’salgorithm to find the SPT?If so, please explain why.If not, please give a digraph example.

Course Hero member to access this document

Course Hero member to access this document

End of preview. Want to read all 10 pages?

Course Hero member to access this document

Term
Fall
Professor
N/A
Tags
CSC, Vertex, Shortest path problem, edges, SPT
##### We have textbook solutions for you!
The document you are viewing contains questions related to this textbook.
The document you are viewing contains questions related to this textbook.
Chapter 1 / Exercise 107
Precalculus with Limits: A Graphing Approach
Larson
Expert Verified