Consider the recursive algorithm in Figure 10.80 for finding the shortest weighted path in an acyclic graph,
Question:
a. Why does this algorithm not work for general graphs?
b. Prove that this algorithm terminates for acyclic graphs.
c. What is the worst-case running time of the algorithm?
Transcribed Image Text:
Distance shortest( s,t ) Distance di, tmp; if( s == t ) return 0; de 00; for each Vertex v adjacent to s { tmp = shortest (v, t ); if( Cs,y + tmp < d¿) di = Csy + tmp; } return d;; }
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 72% (11 reviews)
a If the graph has a cycle then the recursion does not alway...View the full answer
Answered By
Somshukla Chakraborty
I have a teaching experience of more than 4 years by now in diverse subjects like History,Geography,Political Science,Sociology,Business Enterprise,Economics,Environmental Management etc.I teach students from classes 9-12 and undergraduate students.I boards I handle are IB,IGCSE, state boards,ICSE, CBSE.I am passionate about teaching.Full satisfaction of the students is my main goal.
I have completed my graduation and master's in history from Jadavpur University Kolkata,India in 2012 and I have completed my B.Ed from the same University in 2013. I have taught in a reputed school of Kolkata (subjects-History,Geography,Civics,Political Science) from 2014-2016.I worked as a guest lecturer of history in a college of Kolkata for 2 years teaching students of 1st ,2nd and 3rd year. I taught Ancient and Modern Indian history there.I have taught in another school in Mohali,Punjab teaching students from classes 9-12.Presently I am working as an online tutor with concept tutors,Bangalore,India(Carve Niche Pvt.Ltd.) for the last 1year and also have been appointed as an online history tutor by Course Hero(California,U.S) and Vidyalai.com(Chennai,India).
4.00+
2+ Reviews
10+ Question Solved
Related Book For
Data Structures and Algorithm Analysis in Java
ISBN: 978-0132576277
3rd edition
Authors: Mark A. Weiss
Question Posted:
Students also viewed these Computer Sciences questions
-
Assume a packet is made only of four 16-bit words (A7A2) 16 , (CABF) 16 , (903A) 16 , and (A123) 16 . Manually simulate the algorithm in Figure 10.17 to find the checksum. Figure 10.17 Figure 10.17...
-
Describe a recursive algorithm for finding the maximum element in an array, A, of n elements. What is your running time and space usage?
-
Consider the problem of finding the shortest path between two points on a plane that has convex polygonal obstacles as shown in Figure 3.31. This is an idealization of the problem that a robot has to...
-
Doug Robinson and Dante are considering the possibility of opening their own manufacturing facility. They expect first-year sales to be $800,000, and they feel that their variable costs will be...
-
A rocket for use in deep space is to be capable of boosting a total load (payload plus rocket frame and engine) of 3.00 metric tons to a speed of 10 000 m/s. (a) It has an engine and fuel designed to...
-
Evaluate each of the following. 7a 6[4 (3a + 6)]
-
An activity on bias. Lets study bias in an intuitive measurement. Figure 8.3 is a drawing of a tilted glass. Reproduce this drawing on 10 sheets of paper. Choose 10 people: 5 men and 5 women. Explain...
-
SuperShades operates a kiosk at the local mall, selling sunglasses for $ 20 each. SuperShades currently pays $ 800 a month to rent the space and pays two full-time employees to each work 160 hours a...
-
5) A debt of $63 100.00 is repaid by payments of $4350.00 made at the end of every six months. Interest is 6.5% compounded quarterly. a) What is the number of payments needed to retire the debt? b)...
-
As a second-year financial analyst for A.J. Straub Investments, you are performing an initial analysis on Reliant Pharmaceuticals. A difficulty youve encountered in making comparisons with its chief...
-
In the game of chess, a knight in row R and column C may move to row 1 R' B and column 1 C' B (where B is the size of the board) provided that either |R - R'| = 2 and |C - C'| = 1 or |R - R'| =1...
-
Let A be an N-by-N matrix of zeros and ones. A submatrix S of A is any group of contiguous entries that forms a square. a. Design an O(N2) algorithm that determines the size of the largest submatrix...
-
Reply as to whether you believe the following statements are correct (C) or incorrect (I) concerning PPS sampling. a. The size of a PPS sample is not based on the estimated variation of audited...
-
POTI ENTERPRISES LTD. STATEMENT OF INCOME FOR THE YEAR ENDED DECEMBER 31 (current year) SALES $600,000 COST OF SALES: $50,000 OPENING INVENTORY 250,000 PURCHASES 300,000 CLOSING INVENTORY 60,000...
-
10. Describe a qualified defined contribution plan for the self-employed and discuss the advantages and disadvantages in adopting this type of plan. 11. Describe a SEP IRA and discuss the advantages...
-
7.) In 1999, the average percentage of women who received prenatal care per country is 80.1%. Table #7.3.9 contains the percentage of woman receiving prenatal care in 2009 for a sample of countries...
-
Describe A demographic profile of the population and community that will be served through the reinvented Human Service program. The description must include all eligibility requirements (i.e.,...
-
You work for a major financial institution. Your branch handles customer calls from a wide variety of individuals. Recently, you've noticed an increase in calls from individuals from African...
-
The following matrix represents a simple social network. If a column of a social network matrix contains only I's (except on the main diagonal), what can be said about the person represented by that...
-
SCHEDULE OF COST OF GOODS MANUFACTURED The following information is supplied for Sanchez Welding and Manufacturing Company. Prepare a schedule of cost of goods manufactured for the year ended...
-
Assume (for simplicity in this exercise) that only one tuple fits in a block and memory holds at most 3 page frames. Show the runs created on each pass of the sort-merge algorithm, when applied to...
-
Let relations r1 (A, B, C) and r2 (C, D, E) have the following properties: r1 has 20,000 tuples, r2 has 45,000 tuples, 25 tuples of r1 fit on one block, and 30 tuples of r2 fit on one block. Estimate...
-
Design a variant of the hybrid mergejoin algorithm for the case where both relations are not physically sorted, but both have a sorted secondary index on the join attributes.
-
Comfort Golf Products is considering whether to upgrade its equipment Managers are considering two options. Equipment manufactured by Stenback Inc. costs $1,000,000 and will last five years and have...
-
Weaver Corporation had the following stock issued and outstanding at January 1, Year 1: 71,000 shares of $10 par common stock. 8,500 shares of $60 par, 6 percent, noncumulative preferred stock. On...
-
Read the following case and then answer questions On 1 January 2016 a company purchased a machine at a cost of $3,000. Its useful life is estimated to be 10 years and then it has a residual value of...
Study smarter with the SolutionInn App